npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@forteplatforms/sdk

v1.0.176

Published

Official TypeScript SDK for Forte Platforms

Readme

Forte Platforms TypeScript SDK

Official TypeScript SDK for interacting with the Forte Platforms API.

Installation

npm install @forteplatforms/sdk

Authentication

The SDK supports three auth modes depending on where it runs.

Inside a Forte-hosted service (no config)

FORTE_API_TOKEN is set automatically and scoped to the service's project:

const client = new ForteClient();

Client-side (browser / mobile)

For calls to client.users.*, construct with no arguments. The browser sends the Forte-User-Session-Token cookie automatically after the user logs in. The SDK sets credentials: 'include' so the cookie reaches the API cross-origin.

const client = new ForteClient();
await client.users.renewSessionToken({ projectId });

Do not pass apiToken from browser code — it's a server-side secret.

Server-side BFF calling client.users.* (no token, per-call authorization)

In a BFF that proxies user-scoped calls, omit the token and forward each user's session token as the authorization parameter on each call:

const client = new ForteClient();
await client.users.renewSessionToken({
  projectId,
  authorization: `Bearer ${userSessionToken}`,
});

External server-side calling client.projects.* (explicit token)

const client = new ForteClient({ apiToken: 'your_api_token_here' });

Or set FORTE_API_TOKEN in the environment (Node.js only) and call new ForteClient().

You can generate an API token from the Forte Platforms dashboard.

Quick Start

import { ForteClient } from '@forteplatforms/sdk';

const client = new ForteClient();

// List your projects
const projects = await client.projects.listProjects();

// Get a specific project
const project = await client.projects.getProject({ projectId: 'your-project-id' });

Error Handling

API errors are thrown as exceptions with HTTP status information:

try {
  const project = await client.projects.getProject({ projectId: 'invalid-id' });
} catch (error) {
  console.error('API error:', error);
}

User Custom Attributes

Store arbitrary key-value metadata on your users. Useful for tracking subscription tiers, feature flags, preferences, or any application-specific data.

// Set custom attributes on a user
const user = await client.projects.putUserCustomAttributes({
  projectId: 'your-project-id',
  userId: 'user-id',
  requestBody: {
    plan: 'pro',
    referral_source: 'google',
    onboarding_completed: 'true',
  },
});

console.log(user.customMetadataAttributes);
// { plan: 'pro', referral_source: 'google', onboarding_completed: 'true' }

Key constraints:

  • Keys must be 1-64 characters: letters, numbers, underscores, and hyphens only
  • Values are strings
  • Each call replaces all existing attributes — include any you want to keep

Merge with existing attributes

// Read current attributes, then merge
const user = await client.projects.getProjectUser({
  projectId: 'your-project-id',
  userId: 'user-id',
});

await client.projects.putUserCustomAttributes({
  projectId: 'your-project-id',
  userId: 'user-id',
  requestBody: {
    ...user.customMetadataAttributes,
    plan: 'enterprise', // update one field
  },
});

API Reference

client.projects

Manage projects and services on Forte Platforms.

client.users

Manage end-users within your projects.