medusa_js_dart 0.0.6 copy "medusa_js_dart: ^0.0.6" to clipboard
medusa_js_dart: ^0.0.6 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.

Badges #

style: lint

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_js_dart/medusa_js_dart.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