pietro-bertarini-riseworks
v1.0.18
Published
Rise SDK for webhook validation and TypeScript types
Maintainers
Readme
Rise SDK
Official TypeScript/JavaScript SDK for Rise B2B integrations.
It includes:
- A typed API client for B2B and
v2endpoints - Claude-style AI coding skills you can copy into
.claude/skills/ - Built-in webhook validation
Installation
npm install riseworks-sdkQuick Start
import { RiseApiClient } from 'riseworks-sdk'
const client = new RiseApiClient({
environment: 'stg',
jwtToken: process.env.RISE_JWT_TOKEN!,
})
const me = await client.me.get()
const organizations = await client.user.getOrganizations()AI Coding Skills
The npm package ships reusable Claude-style SKILL.md files for coding assistants.
Add skills from the CLI (no copy-paste):
# Add all skills to all supported agents (default)
npx riseworks-sdk add-skills
# Add to one agent only
npx riseworks-sdk add-skills --agent cursor rise-sdk-integration rise-webhooks
# List available skills and supported agents
npx riseworks-sdk add-skills --listOr copy manually from node_modules/riseworks-sdk/ai-skills/ into .claude/skills/, .cursor/skills/, etc.
Available skills:
rise-sdk-integrationrise-v1-migrationrise-payments-workflowsrise-webhooksrise-teams-and-invitesrise-auth-and-setuprise-security-and-approvalsrise-debugging-and-errors
Use these when you want Claude Code or a similar coding assistant to write better Rise integration code.
Low-Level API Groups
The lower-level client remains available for direct endpoint access.
client.authclient.webhooksclient.companyclient.organizationsclient.entityBalanceclient.invitesclient.meclient.paymentsclient.billPayclient.payrollclient.teamclient.teamsclient.userclient.withdraw
Branded ID types
The SDK exports branded nanoid types for API params and responses. Use them when you have a plain string from a response and need to pass it to another method:
| Type | Use case |
|------|----------|
| TeamNanoid | payments.get(), teams.get(), teams.getUsers(), billPay.*, payroll, invites |
| UserNanoid | teams.getMemberSettings(), company members |
| CompanyNanoid | teams.create(), company APIs, webhooks |
| WithdrawAccountNanoid | withdraw.get(), withdraw.prepare(), withdraw.getFee() |
| WebhookEndpointNanoid | webhooks.get(), webhooks.update(), webhooks.test() |
| WebhookDeliveryNanoid | webhooks.retryDelivery(), delivery history |
| InviteNanoid | Invite execute/list flows |
| TransactionNanoid | Typing payment/withdraw response transaction fields |
import {
RiseApiClient,
type TeamNanoid,
type UserNanoid,
type CompanyNanoid,
type WithdrawAccountNanoid,
type WebhookEndpointNanoid,
type WebhookDeliveryNanoid,
type InviteNanoid,
type TransactionNanoid,
} from 'riseworks-sdk'
const client = new RiseApiClient({ environment: 'stg', jwtToken: '…' })
const { data } = await client.user.getTeams()
const teamNanoid = data?.teams?.[0]?.nanoid // string
await client.payments.get({
team_nanoid: teamNanoid as TeamNanoid,
state: 'all',
query_type: 'payable',
start_date: new Date(),
end_date: new Date(),
})Examples
Teams
const team = await client.teams.get({ team_nanoid: 'te_123' })
await client.teams.update(
{ team_nanoid: 'te_123' },
{ name: 'Finance Ops' },
)
const members = await client.teams.getUsers({ team_nanoid: 'te_123' })Bill Pay
await client.billPay.createRecipient(
{ team_nanoid: 'te_123' },
{ email: '[email protected]' },
)
const payment = await client.billPay.sendInstantPayment({
from: 'te_123',
amount_cents: 125000,
currency_symbol: 'USD',
external_recipient_email: '[email protected]',
payment_data: {
role_description: 'Design work',
invoice_description: 'Invoice INV-2026-001',
services_description: 'Landing page design',
payment_details: 'Net 15',
rise_sow: false,
},
})Treasury
const balance = await client.entityBalance.get({
nanoid: 'te_123',
})
const fee = await client.withdraw.getFee(
{ account_nanoid: 'wa_123' },
{
source_currency: 'USD',
destination_currency: 'USD',
workspace_nanoid: 'te_123',
},
)
const result = await client.withdraw.sendWithdraw(
{ account_nanoid: 'wa_123' },
{
from: 'us_123',
amount_cents: 50000,
source_currency: 'USD',
workspace_nanoid: 'te_123',
},
)
console.log(fee.data)
console.log(result.data.transaction)Webhooks
import express from 'express'
import { WebhookValidator } from 'riseworks-sdk'
const app = express()
const validator = new WebhookValidator(process.env.RISE_WEBHOOK_SECRET!)
app.post('/rise-webhooks', express.raw({ type: 'application/json' }), (req, res) => {
try {
const event = validator.validateEvent(
req.body,
req.headers['x-rise-signature'] as string,
)
console.log(event.event_type)
res.status(200).json({ received: true })
} catch (error) {
res.status(400).json({
error: error instanceof Error ? error.message : 'Webhook validation failed',
})
}
})Exports
The package exports:
RiseApiClientWebhookValidator- Webhook event types
- Generated API request/response types
Authentication
You can authenticate with either:
jwtTokenriseIdAuthfor automatic SIWE-based JWT generation and refresh
const client = new RiseApiClient({
environment: 'prod',
riseIdAuth: {
riseId: process.env.RISE_ID!,
privateKey: process.env.RISE_PRIVATE_KEY!,
},
})License
MIT
