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

@wix/ai

v1.5.0

Published

Wix AI SDK

Readme

@wix/ai

npm version License: MIT TypeScript

Wix AI SDK for the Vercel AI SDK. Provides access to AI models through Wix infrastructure with automatic authentication.

⚠️ Note: This package depends on Vercel AI SDK v6 (currently in beta).

Supported Providers

| Provider | Status | Capabilities | |----------|--------|--------------| | OpenAI | ✅ Available | Text generation, chat, embeddings | | Runware | ✅ Available | Image generation |

Installation

npm install @wix/ai

Requirements:

  • ai@>=6.0.27 (Vercel AI SDK v6)
  • zod@^4.1.8

Quick Start

Wix Environment (Blocks, Wix CLI Apps)

import { generateText } from 'ai';
import { openai } from '@wix/ai';

const { text } = await generateText({
  model: openai('gpt-4o'),
  prompt: 'What is the capital of France?',
});

Self-Hosted Apps

For apps running outside Wix, pass a WixClient configured with AppStrategy or ApiKeyStrategy:

import { generateText } from 'ai';
import { createOpenAI } from '@wix/ai';
import { createClient, AppStrategy } from '@wix/sdk';

const wixClient = createClient({
  auth: AppStrategy({
    appId: 'YOUR_APP_ID',
    appSecret: 'YOUR_APP_SECRET',
    instanceId: 'YOUR_INSTANCE_ID',
  }),
});

const openai = createOpenAI({ client: wixClient });

const { text } = await generateText({
  model: openai('gpt-4o'),
  prompt: 'What is the capital of France?',
});

Requirements

  • ✅ Wix backend code (API routes, server functions)
  • ✅ Self-hosted apps (with WixClient using AppStrategy or ApiKeyStrategy)
  • ❌ Browser/client-side code

Technical requirements:

  • Node.js 18+
  • ai package v6.0.0+

API Reference

OpenAI Provider

Responses API (Default)

import { generateText } from 'ai';
import { openai } from '@wix/ai';

const { text } = await generateText({
  model: openai('gpt-4o'),
  prompt: 'Explain quantum computing.',
});

Or explicitly:

const model = openai.responses('gpt-4o');

Chat Completions

import { generateText } from 'ai';
import { openai } from '@wix/ai';

const { text } = await generateText({
  model: openai.chat('gpt-4o'),
  messages: [
    { role: 'system', content: 'You are a helpful assistant.' },
    { role: 'user', content: 'What is TypeScript?' },
  ],
});

Embeddings

import { embed, cosineSimilarity } from 'ai';
import { openai } from '@wix/ai';

const { embedding } = await embed({
  model: openai.embeddingModel('text-embedding-3-small'),
  value: 'Hello world',
});

const similarity = cosineSimilarity(embedding1, embedding2);

Batch embeddings:

import { embedMany } from 'ai';
import { openai } from '@wix/ai';

const { embeddings } = await embedMany({
  model: openai.embeddingModel('text-embedding-3-small'),
  values: ['Hello', 'World', 'Foo', 'Bar'],
});

OpenAI Provider Methods

| Method | Description | |--------|-------------| | openai(modelId) | Responses API (default) | | openai.responses(modelId) | Responses API (explicit) | | openai.chat(modelId) | Chat Completions API | | openai.embeddingModel(modelId) | Text embeddings |

Runware Provider

Image Generation

import { generateImage } from 'ai';
import { runware } from '@wix/ai';

const result = await generateImage({
  model: runware.imageModel('runware:101@1'),
  prompt: 'A serene mountain landscape at sunset',
  n: 4, // Generate 4 images in one call
});

Using image() method

import { generateImage } from 'ai';
import { runware } from '@wix/ai';

const result = await generateImage({
  model: runware.image('FLUX.1'),
  prompt: 'A futuristic cityscape at night with neon lights',
});

Self-Hosted Apps

For apps running outside Wix, use createRunware with a WixClient:

import { generateImage } from 'ai';
import { createRunware } from '@wix/ai';
import { createClient, ApiKeyStrategy } from '@wix/sdk';

const wixClient = createClient({
  auth: ApiKeyStrategy({
    siteId: 'YOUR_SITE_ID',
    apiKey: 'YOUR_API_KEY',
  }),
});

const runware = createRunware({ client: wixClient });

const result = await generateImage({
  model: runware.imageModel('runware:101@1'),
  prompt: 'A beautiful sunset over mountains',
  n: 2,
});

Runware Provider Methods

| Method | Description | |--------|-------------| | runware.image(modelId) | Image generation (shortcut method) | | runware.imageModel(modelId) | Image generation model |

License

MIT