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
42 changes: 5 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,56 +23,24 @@ pnpm add @ambosstech/payments
import { Payments } from '@ambosstech/payments';

const payments = new Payments({
apiKey: process.env.AMBOSS_API_KEY,
serviceApiKey: process.env.AMBOSS_API_KEY,
webhookSecret: process.env.AMBOSS_WEBHOOK_SECRET,
});

// verify an incoming webhook (no apiKey required for this)
// verify an incoming webhook (no key required for this)
const event = payments.webhooks.verify({
payload: rawBody,
signature: headers['x-webhook-signature'],
timestamp: headers['x-webhook-timestamp'],
});

// call the API (requires apiKey)
const wallets = await payments.wallets.list({ environmentId: env.id });
// call the API (requires serviceApiKey)
const [environment] = await payments.environments.list();
const wallets = await payments.wallets.list({ environmentId: environment.id });
```

See [`packages/payments/README.md`](./packages/payments/README.md) for full docs.

## Development

```bash
pnpm install
pnpm typecheck
pnpm test
pnpm build
```

Refresh the pinned GraphQL schema from the dev API:

```bash
pnpm --filter @ambosstech/core run refresh-schema
```

Regenerate typed GraphQL SDK in payments:

```bash
pnpm --filter @ambosstech/payments run codegen
```

## Releasing

This repo uses [Changesets](https://github.com/changesets/changesets) for versioning and publishing.

```bash
pnpm changeset # add a changeset describing your change
pnpm changeset:version # bump versions + update changelogs
pnpm changeset:publish # build + publish to npm
```

CI publishes automatically when changeset PRs merge to `main`.

## License

MIT — see [LICENSE](./LICENSE).
Loading