Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,52 @@ A TypeScript SDK for the OMS (Open Money Stack) platform. Provides email and OID

## Usage

Install the published SDK package in your application:

```bash
pnpm add @0xsequence/typescript-sdk@alpha
```

For npm or yarn projects:

```bash
npm install @0xsequence/typescript-sdk@alpha
yarn add @0xsequence/typescript-sdk@alpha
```

Then initialize the client with your OMS project credentials:

```typescript
import { OMSClient } from '@0xsequence/typescript-sdk'

const oms = new OMSClient({
publicApiKey: 'your-public-api-key',
projectId: 'your-project-id',
})
```

In Vite browser apps, keep those values in local environment variables:

```typescript
function requiredEnv(name: string, value: string | undefined): string {
if (!value) {
throw new Error(`Missing ${name}`)
}
return value
}

const oms = new OMSClient({
publicApiKey: requiredEnv('VITE_OMS_PUBLIC_API_KEY', import.meta.env.VITE_OMS_PUBLIC_API_KEY),
projectId: requiredEnv('VITE_OMS_PROJECT_ID', import.meta.env.VITE_OMS_PROJECT_ID),
})
```

If your app imports utilities from `viem`, such as the `parseUnits` helper used in the quick start below, install it as a direct dependency too:

```bash
pnpm add viem
```

For local development in this repository, install dependencies and build the workspace package:

From the repository root:
Expand Down
Loading