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

@motif-ai/sdk

v0.1.3

Published

Embed AI-powered wealth advisory into your platform — investor profiling, portfolio strategies, and market insights

Readme

@motif-ai/sdk

Embed AI-powered wealth advisory into your platform — investor profiling, portfolio strategies, and market insights.

Homepage | Documentation | Business | Blog

Install

npm install @motif-ai/sdk

Quick Start

import { createClient } from '@motif-ai/sdk'

const client = createClient({
  apiKey: process.env.MOTIF_API_KEY!,
})

// Create a user
const user = await client.users.create({
  email: '[email protected]',
  name: 'Jane Doe',
  externalId: 'your_internal_id_123',
})

// List users
const { data: users } = await client.users.list({ limit: 10 })

User-Scoped Operations

Operations like profiling and strategy recommendations are scoped to a specific user:

const userClient = client.forUser(user.id)

// Get profiling questions
const questions = await userClient.profile.getQuestions({ type: 'Basic' })

// Save an answer
await userClient.profile.saveAnswer({
  questionId: questions[0].id,
  answer: 'Growth',
})

// Compute investor profile from answers
const profile = await userClient.profile.computeInvestorProfile()

// Get recommended investment strategy
const strategy = await userClient.strategies.getRecommended()

Configuration

const client = createClient({
  apiKey: 'pk_live_...', // Required
  baseURL: 'https://api.motifapp.ai/api', // Optional (default)
  timeout: 30000, // Optional, ms (default: 30000)
  headers: { 'x-custom': 'value' }, // Optional extra headers
})

API Reference

createClient(config)

Returns a client with the following namespaces:

client.users

| Method | Description | | ----------------------------- | -------------------------- | | create(data) | Create a new user | | list(params?) | List users with pagination | | get(id) | Get user by ID | | update(id, data) | Update user | | delete(id) | Delete user | | getByExternalId(externalId) | Get user by external ID |

client.forUser(userId)

Returns a user-scoped client with:

profile

| Method | Description | | ------------------------------- | ------------------------------- | | getQuestions(params) | Get profiling questions by tier | | saveAnswer(data) | Save a profiling answer | | getAnswers() | Get all answers | | getInvestorProfile() | Get computed investor profile | | computeInvestorProfile(data?) | Compute/refresh profile | | getCompletion(params) | Check profiling completion |

strategies

| Method | Description | | ------------------ | ---------------------------- | | getRecommended() | Get recommended strategy | | generate(data?) | Generate AI-powered strategy |

Error Handling

import { createClient, MotifSDKError } from '@motif-ai/sdk'

try {
  const user = await client.users.get('invalid_id')
} catch (error) {
  if (error instanceof MotifSDKError) {
    console.error(error.message) // Human-readable message
    console.error(error.statusCode) // HTTP status (e.g. 404)
    console.error(error.response) // Raw response body
  }
}

Requirements

  • Node.js >= 18
  • TypeScript >= 5.0 (optional, for type checking)

License

Proprietary — see LICENSE. Use is permitted solely for integrating with the Motif API.