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.
-
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.
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.
Install medusa-js-dart
using pub:
Coming soon...
To start using the MedusaJS Client in your Dart or Flutter project, follow these steps:
- Import the library in your Dart or Flutter project:
import 'package:medusa_js_dart/medusa_js_dart.dart';
- Initialize the client with your server's details:
final Configuration configuration = Configuration(
baseUrl: 'http://localhost:9000',
maxRetries: 3,
);
final Medusa medusa = Medusa(configuration);
- Make requests as needed:
final AdminAuthRes response = await medusa.admin.auth.createSession(
AdminPostAuthReq(
'[email protected]',
'password',
),
);
print(response.user);