Rise.ai logo

Rise.ai TypeScript SDK

Installation

Get started with the Rise TypeScript SDK in seconds. Choose your preferred package manager:

NPM

npm install rise-ai-sdk

Yarn

yarn add rise-ai-sdk

Prerequisites

  • Node.js 16+ - The SDK requires Node.js version 16.0.0 or later

Authentication Methods

Choose the authentication method that best fits your use case:

API Key Authentication

Simple and secure authentication for server-side applications

Perfect for backend services, scripts, and direct API access

OAuth Authentication

Secure delegated access for multi-tenant applications

Ideal for apps serving multiple merchants or requiring delegated access

API Key Authentication Setup

Required Credentials:

  • API Key from your Rise account
  • Account ID

API Key Authentication Example

Complete example showing how to initialize the SDK with api key authentication

import { RiseSDKClient } from 'rise-ai-sdk';

const sdk = RiseSDKClient.withApiKey({
  token: 'IST.xxx.yyy.zzz',
  accountId: 'your-account-id'
});

// Ready to use!
const giftCards = await sdk.giftCards.queryGiftCards({
  query: { cursorPaging: { limit: 10 } }
});

API Examples

Explore comprehensive examples for all SDK capabilities. Copy and paste these examples to get started quickly:

Create, retrieve, and manage gift cards

Create a Gift Card

Example 1: Create a Gift Card

// Create a new gift card with initial value
const newCard = await sdk.giftCards.createGiftCard({
  giftCard: {
    initialValue: '100',
    sourceInfo: {
      type: 'MANUAL',
      manualOptions: {
        note: 'Welcome gift for new customer'
      }
    }
  }
});

console.log('Gift card created:', newCard.data.giftCard?.id);

Retrieve Gift Card

Example 2: Retrieve Gift Card

// Get gift card by ID
const giftCardId = 'gc_123456789';
const giftCard = await sdk.giftCards.getGiftCard(giftCardId);

console.log('Gift card balance:', giftCard.data.giftCard?.balance);

Query Gift Cards

Example 3: Query Gift Cards

// Query multiple gift cards with pagination
const cards = await sdk.giftCards.queryGiftCards({
  query: {
    cursorPaging: {
      limit: 10
    },
    filter: {
      status: 'ACTIVE'
    }
  }
});

console.log('Found cards:', cards.data.giftCards?.length);