Files
medusa-store/packages/core/js-sdk/src/index.ts
Adrien de Peretti 665b80adb1 feat(): Add support for locale to the js sdk (#14306)
* feat(): Add support for locale to the js sdk

* Create great-icons-thank.md
2025-12-15 13:36:39 +01:00

47 lines
907 B
TypeScript

import { Admin } from "./admin"
import { Auth } from "./auth"
import { Client } from "./client"
import { Store } from "./store"
import { Config } from "./types"
class Medusa {
public client: Client
public admin: Admin
public store: Store
public auth: Auth
constructor(config: Config) {
this.client = new Client(config)
this.admin = new Admin(this.client)
this.store = new Store(this.client)
this.auth = new Auth(this.client, config)
}
setLocale(locale: string) {
this.client.setLocale(locale)
}
getLocale() {
return this.client.locale
}
}
export default Medusa
export { FetchError, Client } from "./client"
export { Admin } from "./admin"
export { Auth } from "./auth"
export { Store } from "./store"
export {
Config,
ClientHeaders,
ClientFetch,
FetchArgs,
FetchInput,
FetchStreamResponse,
Logger,
ServerSentEventMessage,
} from "./types"