medusa_client 0.0.4 copy "medusa_client: ^0.0.4" to clipboard
medusa_client: ^0.0.4 copied to clipboard

A Dart client for interacting with the MedusaJS API.

MedusaJS Client for Dart #

A Dart client library for MedusaJS, providing a seamless way for Dart and Flutter developers to interact with MedusaJS services.

This library is designed to match the functionality of its JavaScript counterpart, offering a comprehensive suite of features tailored for e-commerce applications.

Features #

  • User Authentication: Enables multiple authentication strategies, including API keys and OAuth tokens, to secure your e-commerce applications.

  • API Interaction: Provides complete access to the MedusaJS API endpoints, allowing for robust management and operation of your store.

  • Data Types and Models: Offers strongly-typed Dart classes for all MedusaJS data types, enhancing type safety and development efficiency.

Documentation #

While there is currently no dedicated documentation for this Dart client, you can refer to the JavaScript client documentation as the functionality closely aligns. Additionally, explore the API reference for detailed information on the available endpoints.

Installation #

Install medusa-js-dart using pub:

  Coming soon...

Usage/Examples #

To start using the MedusaJS Client in your Dart or Flutter project, follow these steps:

  1. Import the library in your Dart or Flutter project:
import 'package:medusa_client/medusa_client.dart';
  1. Initialize the client with your server's details:
final Configuration configuration = Configuration(
  baseUrl: 'http://localhost:9000',
  maxRetries: 3,
);

final Medusa medusa = Medusa(configuration);
  1. Make requests as needed:
final AdminAuthRes response = await medusa.admin.auth.createSession(
  AdminPostAuthReq(
    'jonhdoe@mail.com',
    'password',
  ),
);

print(response.user);

License #

MIT

0
likes
90
points
55
downloads

Publisher

unverified uploader

Weekly Downloads

A Dart client for interacting with the MedusaJS API.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

dio, dio_smart_retry, json_annotation, pretty_dio_logger, retrofit

More

Packages that depend on medusa_client