feat(medusa): Modules initializer (#3352)
This commit is contained in:
committed by
GitHub
parent
8a7421db5b
commit
aa690beed7
27
.changeset/grumpy-buses-pump.md
Normal file
27
.changeset/grumpy-buses-pump.md
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
"@medusajs/inventory": patch
|
||||
"medusa-core-utils": patch
|
||||
"@medusajs/medusa": patch
|
||||
---
|
||||
|
||||
feat(medusa): Modules initializer
|
||||
|
||||
### Loading modules in a project
|
||||
|
||||
Example
|
||||
|
||||
``` typescript
|
||||
import { InventoryServiceInitializeOptions, initialize } from "@medusajs/inventory"
|
||||
|
||||
const options: InventoryServiceInitializeOptions = {
|
||||
database: {
|
||||
type: "postgres",
|
||||
url: DB_URL,
|
||||
},
|
||||
}
|
||||
|
||||
const inventoryService = await initialize(options)
|
||||
const newInventoryItem = await inventoryService.createInventoryItem({
|
||||
sku: "sku_123",
|
||||
})
|
||||
```
|
||||
Reference in New Issue
Block a user