open-index/open-npm huggingface dataset:
npm package: @restackio/integrations-azurespeech
Description: This package provides an integration for Azure Speech services with Restack, allowing easy text-to-speech conversion using Microsoft's Cognitive Services.
Latest version: 0.0.10

# Azure Speech Integration for Restack

This package provides an integration for Azure Speech services with Restack, allowing easy text-to-speech conversion using Microsoft's Cognitive Services.

## Installation

To install the package, use npm or yarn:

```bash
npm install @restackio/integrations-azurespeech
```

## Configuration

Before using the Azure Speech integration, you need to set up your Azure credentials. You can do this by setting environment variables or passing them directly to the functions.

1. Set up environment variables:

```bash
AZURE_SPEECH_API_KEY=your_azure_speech_api_key
AZURE_SPEECH_REGION=your_azure_speech_region
```

2. Or pass them directly when calling the functions (see Usage section).

## Usage

### Starting the Azure Speech Service

To start the Azure Speech service, use the `azureSpeechService` function:

```typescript
// services.ts
import Restack from "@restackio/ai";
import { azureSpeechService } from "@restackio/integrations-azurespeech";

export async function services() {
  const client = new Restack();
  azureSpeechService({ client }).catch((err) => {
    console.error("Error starting Azure Speech service:", err);
  });
}

services().catch((err) => {
  console.error("Error running services:", err);
});
```

### Using the Azure Speech Function

The main function provided by this integration is `azureSpeech`. Here's how to use it inside a workflow as part of one of its steps:

```typescript
/// workflows/createRelease.ts

import { log, step } from "@restackio/ai/workflow";
import * as azureFunctions from "@restackio/integrations-azurespeech/functions";
import { azureSpeechTaskQueue } from "@restackio/integrations-azurespeech/taskQueue";

export async function azureSpeechWorkflow() {
  const result = await step<typeof azureFunctions>({
    taskQueue: azureSpeechTaskQueue,
  }).azureSpeech({
    text: "Hello, world!",
    config: {
      voiceName: "en-US-DavisNeural",
      format: sdk.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3,
    },
    apiKey: "your_azure_speech_api_key", // Optional if set in environment variables
    region: "your_azure_speech_region", // Optional if set in environment variables
  });
  log.info("result", { result: result.media.payload }); // Base64 encoded audio data
  return result;
}
```
npm package: @restackio/integrations-cartesia
Description: This package provides integration with Cartesia AI services for Restack applications.
Latest version: 0.0.9

# Cartesia Integration for Restack

This package provides integration with Cartesia AI services for Restack applications.

## Installation

To install the package, use npm or yarn:

```bash
npm install @restackio/integrations-cartesia
```

## Configuration

Before using the Cartesia integration, make sure to set up your Cartesia API key. You can do this by setting the `CARTESIA_API_KEY` environment variable or by passing it directly to the functions.

## Usage

### Starting the Cartesia Service

To start the Cartesia service, use the `cartesiaService` function:

```typescript
// services.ts
import Restack from "@restackio/ai";
import { cartesiaService } from "@restackio/integrations-cartesia";

export async function services() {
  const client = new Restack();
  cartesiaService({ client }).catch((err) => {
    console.error("Error starting Cartesia service:", err);
  });
}

services().catch((err) => {
  console.error("Error running services:", err);
});
```

### Text-to-Speech Function

The package provides a Text-to-Speech function that converts text to audio bytes: Here's how to use it inside a workflow as part of one of its steps:

```typescript
// cartesiaSpeechToWorflow.ts
import { log, step } from "@restackio/ai/workflow";
import * as cartesiaFunctions from "@restackio/integrations-cartesia/functions";
import { cartesiaTaskQueue } from "@restackio/integrations-cartesia/taskQueue";

export async function cartesiaSpeechToTextWorkflow() {
  const result = await step<typeof cartesiaFunctions>({
    taskQueue: cartesiaTaskQueue,
  }).cartesiaTtsBytes({
    text: "Hello, world!",
    apiKey: "your-api-key", // Optional if CARTESIA_API_KEY is set in environment
  });
  log.info("result", { result: result.media.payload }); // Base64 encoded audio data
  return result;
}
```
npm package: @restackio/integrations-deepgram
Description: This package provides an integration for Deepgram's speech-to-text and text-to-speech services within the Restack AI framework.
Latest version: 0.0.13

# Restack Deepgram Integration

This package provides an integration for Deepgram's speech-to-text and text-to-speech services within the Restack AI framework.

## Installation

To install the Deepgram integration, use npm or yarn:

```bash
npm install @restackio/integrations-deepgram
```

## Configuration

Before using the Deepgram integration, make sure to set up your Deepgram API key. You can do this by setting the `DEEPGRAM_API_KEY` environment variable or by passing the API key directly to the client.

## Usage

### Initializing the Deepgram Service

To start the Deepgram service:

```typescript
// services.ts

import Restack from "@restackio/ai";
import { deepgramService } from "@restackio/integrations-deepgram";

export async function services() {
  const client = new Restack();
  deepgramService({ client }).catch((err) => {
    console.error("Error starting Deepgram service:", err);
  });
}

services().catch((err) => {
  console.error("Error running services:", err);
});
```

### Available Functions

This integration provides two main functions:

1. `deepgramListen`: Transcribe audio to text
2. `deepgramSpeak`: Convert text to speech

#### Transcribing Audio (Speech-to-Text)

```typescript
// transcribeAudioWorkflow.ts

import { log, step } from "@restackio/ai/workflow";
import * as deepgramFunctions from "@restackio/integrations-deepgram/functions";
import { deepgramTaskQueue } from "@restackio/integerations-deepgram/taskQueue";

export async function transcribeAudioWorkflow() {
  const result = await step<typeof deepgramFunctions>({
    taskQueue: deepgramTaskQueue,
  }).deepgramListen({
    base64Payload: "your_base64_encoded_audio",
    options: {
      model: "nova-2",
      punctuate: true,
      interim_results: true,
      endpointing: 500,
      utterance_end_ms: 2000,
    },
  });
  log.info("result", { result: result.transcript });
}
```

#### Converting Text to Speech

```typescript
import { log, step } from "@restackio/ai/workflow";
import * as deepgramFunctions from "@restackio/integrations-deepgram/functions";
import { deepgramTaskQueue } from "@restackio/integerations-deepgram/taskQueue";

export async function deepgramSpeakWorkflow() {
  const result = await step<typeof deepgramFunctions>({
    taskQueue: deepgramTaskQueue,
  }).deepgramSpeak({
    text: "Hello, world!",
    options: {
      model: "aura-arcas-en",
    },
  });
  log.info("result", { result: result.media.payload }); // Base64 encoded audio
}
```
npm package: @restackio/integrations-elevenlabs
Description: This package provides an integration with ElevenLabs API for text-to-speech conversion using Restack.
Latest version: 0.0.10

# @restackio/integrations-elevenlabs

This package provides an integration with ElevenLabs API for text-to-speech conversion using Restack.

## Installation

To install the package, use npm or yarn:

```bash
npm install @restackio/integrations-elevenlabs
```

## Usage

### Setting up the ElevenLabs service

First, import the necessary modules and set up the ElevenLabs service:

```typescript
// services.ts
import Restack from "@restackio/ai";
import { elevenlabsService } from "@restackio/integrations-elevenlabs";

export async function services() {
  const client = new Restack();
  elevenlabsService({ client }).catch((err) => {
    console.error("Error starting ElevenLabs service:", err);
  });
}

services().catch((err) => {
  console.error("Error running services:", err);
});
```

### Converting text to speech

To convert text to speech, use the `elevenlabsConvert` function:

```typescript
// convertTextToSpeech.ts

import { log, step } from "@restackio/ai/workflow";
import * as elevenLabsFunctions from "@restackio/integrations-elevenlabs/functions";
import { elevenlabsTaskQueue } from "@restackio/integerations-elevenlabs/taskQueue";

export async function convertTextToSpeechWorkflow() {
  const result = await step<typeof elevenLabsFunctions>({
    taskQueue: elevenlabsTaskQueue,
  }).elevenlabsConvert({
    text: "Hello, world!",
    apiKey: "YOUR_ELEVENLABS_API_KEY",
  });
  log.info("result", { result: result.media.payload }); // Base64 encoded audio
}
```

## Configuration

The `elevenlabsConvert` function accepts the following parameters:

- `text` (required): The text to convert to speech.
- `voiceId` (optional): The ID of the voice to use. Defaults to "fCxG8OHm4STbIsWe4aT9".
- `options` (optional): Additional options for the text-to-speech conversion.
- `twilioEncoding` (optional): Set to enable Twilio-compatible encoding.
- `apiKey` (required): Your ElevenLabs API key.

## Environment Variables

To use the ElevenLabs client without explicitly passing the API key, set the following environment variable:

```bash
ELEVENLABS_API_KEY=your_api_key_here
```
npm package: @restackio/integrations-fal
Description: This package provides an integration between Restack and Fal AI, allowing you to easily use Fal's AI services within your Restack applications.
Latest version: 0.0.10

# Restack Fal Integration

This package provides an integration between Restack and Fal AI, allowing you to easily use Fal's AI services within your Restack applications.

## Installation

To install the Restack Fal integration, use npm or yarn:

```bash
npm install @restackio/integrations-fal
```

## Configuration

Before using the Fal integration, you need to set up your Fal API key. You can do this by setting the `FAL_API_KEY` environment variable or by passing the API key directly when initializing the client.

## Usage

### Starting the Fal Service

To start the Fal service, you can use the `falService` function:

```typescript
// services.ts
import Restack from "@restackio/ai";
import { falService } from "@restackio/integrations-fal";

export async function services() {
  const client = new Restack();
  falService({ client }).catch((err) => {
    console.error("Error starting Fal service:", err);
  });
}

services().catch((err) => {
  console.error("Error running services:", err);
});
```

### Running Fal Functions

The main function provided by this integration is `falRun`, which allows you to generate images using Fal's AI models. Here's an example of how to use it on a workflow as a step:

```typescript
// falRunWorkflow.ts

import { log, step } from "@restackio/ai/workflow";
import * as falFunctions from "@restackio/integrations-fal/functions";
import { falTaskQueue } from "@restackio/integerations-fal/taskQueue";

export async function falRunWorkflow() {
  const result = await step<typeof falFunctions>({
    taskQueue: falTaskQueue,
  }).falRun({
    id: "fal-ai/flux/dev",
    prompt: "A beautiful sunset over the ocean",
    imageSize: "landscape_16_9",
    numImages: 1,
  });
  log.info("result", { result });
}
```
npm package: @restackio/integrations-github
Description: This package provides integration with Github, allowing you to create and publish releases programmatically using the Github API.
Latest version: 1.1.5

# @restackio/integrations-github

This package provides integration with Github, allowing you to create and publish releases programmatically using the Github API.

## Installation

To install the package, use npm or yarn:

```bash
npm install @restackio/integrations-github
```

## Usage

Make sure to create an access token on your github account and set the token as environment variabled named `GITHUB_AUTH_TOKEN`

### Setting up the Github service

To use the Github integration, you need to set up the Github service:

```typescript
// services.ts
import Restack from "@restackio/ai";
import { githubService } from "@restackio/integrations-github";

export async function services() {
  const client = new Restack();
  githubService({ client }).catch((err) => {
    console.error("Error starting Github service:", err);
  });
}

services().catch((err) => {
  console.error("Error running services:", err);
});
```

### Creating a release

To create a release for a provided repository on Github:

```typescript
/// workflows/createRelease.ts

import { log, step } from "@restackio/ai/workflow";
import { githubTaskQueue } from "@restackio/integrations-github/taskQueue";
import * as githubFunctions from "@restackio/integrations-github/functions";

import * as functions from "../functions";

export async function createReleaseWorkflow({
  owner,
  repo,
  tagName,
  releaseName,
  releaseBody,
  branch,
}: {
  owner: string;
  repo: string;
  tagName: string;
  releaseName: string;
  releaseBody: string;
  branch?: string;
}) {
  const createdRelease = await step<typeof githubFunctions>({
    taskQueue: githubTaskQueue,
  }).createRelease({
    owner,
    repo,
    tagName,
    releaseName,
    releaseBody,
    branch,
  });

  return createdRelease;
}
```

### Publishing a release

To mark the release as published on Github:

```typescript
/// workflows/publishRelease.ts

import { log, step } from "@restackio/ai/workflow";
import { githubTaskQueue } from "@restackio/integrations-github/taskQueue";
import * as githubFunctions from "@restackio/integrations-github/functions";

import * as functions from "../functions";

export async function publishReleaseWorkflow({
  owner,
  repo,
  id,
}: {
  owner: string;
  repo: string;
  id: number;
}) {
  const publishedRelease = await step<typeof githubFunctions>({
    taskQueue: githubTaskQueue,
  }).publishRelease({
    owner,
    repo,
    id.
  });

  return publishedRelease;
}
```

## Configuration

The Github client is configured using an access token. You can either pass the API key directly to the functions or set it as an environment variable:

```bash
GITHUB_AUTH_TOKEN=your-access-token
```
npm package: @restackio/integrations-google-gemini
Description: This package provides an integration for Google's Gemini AI API, specifically tailored for use with the Restack AI framework.
Latest version: 0.0.3

# @restackio/integrations-google-gemini

This package provides an integration for Google's Gemini AI API, specifically tailored for use with the Restack AI framework.

## Installation

To install the package, use npm or yarn:

```bash
npm install @restackio/integrations-google-gemini
```

## Features

- Gemini Text Generation (base and streaming)
- Rate limiting support (2000 RPM default)
- Simple prompt handling
- Event streaming
- Temperature and other parameter controls

## Usage

### Basic Setup

```typescript
// services.ts
import Restack from "@restackio/ai";
import { geminiService } from "@restackio/integrations-google-gemini";

export async function services() {
  const client = new Restack();
  geminiService({ client, options: { rateLimit: 2000 } }).catch((err) => {
    console.error("Error starting Gemini service:", err);
  });
}

services().catch((err) => {
  console.error("Error running services:", err);
});
```

### Text Generation

For basic text generation:

```typescript
// geminiGenerateContent.ts

import { log, step } from "@restackio/ai/workflow";
import * as geminiFunctions from "@restackio/integrations-google-gemini/functions";
import { geminiTaskQueue } from "@restackio/integrations-google-gemini/taskQueue";

export async function geminiGenerateContentWorkflow() {
  const response = await step<typeof geminiFunctions>({
    taskQueue: geminiTaskQueue,
  }).geminiGenerateContent({
    userContent: "Hello, how are you?",
    model: "gemini-pro",
    apiKey: "your-api-key-here",
    params: {
      temperature: 0.9,
      topP: 1,
      topK: 1,
      candidateCount: 1,
    },
  });
}
```

For streaming text generation:

```typescript
// streamingGeneration.ts

import { log, step } from "@restackio/ai/workflow";
import * as geminiFunctions from "@restackio/integrations-google-gemini/functions";
import { geminiTaskQueue } from "@restackio/integrations-google-gemini/taskQueue";

export async function streamingGenerationWorkflow() {
  const response = await step<typeof geminiFunctions>({
    taskQueue: geminiTaskQueue,
  }).geminiGenerateContentStream({
    userContent: "Tell me a story",
    model: "gemini-pro",
    systemContent: "You are a creative storyteller",
    params: {
      temperature: 0.9,
      maxOutputTokens: 1000,
    },
    apiKey: "your-api-key-here",
  });
}
```

## Configuration

The package uses environment variables for configuration. Make sure to set:

- \`GEMINI_API_KEY\`: Your Google API key for Gemini
npm package: @restackio/integrations-linear
Description: This package provides integration with Linear, allowing you to create issues and comments programmatically using the Linear API.
Latest version: 0.0.8

# @restackio/integrations-linear

This package provides integration with Linear, allowing you to create issues and comments programmatically using the Linear API.

## Installation

To install the package, use npm or yarn:

```bash
npm install @restackio/integrations-linear
```

## Usage

### Setting up the Linear service

To use the Linear integration, you need to set up the Linear service:

```typescript
// services.ts
import Restack from "@restackio/ai";
import { linearService } from "@restackio/integrations-linear";

export async function services() {
  const client = new Restack();
  linearService({ client }).catch((err) => {
    console.error("Error starting Linear service:", err);
  });
}

services().catch((err) => {
  console.error("Error running services:", err);
});
```

### Creating an issue

To create an issue in Linear:

```typescript
// createIssueWorflow.ts

import { step } from "@restackio/ai/workflow";
import * as linearFunctions from "@restackio/integrations-linear/functions";
import { linearTaskQueue } from "@restackio/integrations-linear/taskQueue";

export async function createIssueWorkflow() {
  const result = await step<typeof linearFunctions>({
    taskQueue: linearTaskQueue,
  }).linearCreateIssue({
    issue: {
      title: "New issue",
      description: "This is a new issue created via the API",
      teamId: "your-team-id",
    },
    apiKey: "your-linear-api-key",
  });
}
```

## Configuration

The Linear client is configured using an API key. You can either pass the API key directly to the functions or set it as an environment variable:

```bash
LINEAR_API_KEY=your-linear-api-key
```
npm package: @restackio/integrations-lumaai
Description: This package provides integration with LumaAI for the Restack platform. It allows you to generate, retrieve, and list AI-generated content using LumaAI's powerful API.
Latest version: 0.0.14

# @restackio/integrations-lumaai

This package provides integration with LumaAI for the Restack platform. It allows you to generate, retrieve, and list AI-generated content using LumaAI's powerful API.

## Installation

To install the package, use npm or yarn:

```bash
npm install @restackio/integrations-lumaai
```

## Configuration

Before using the LumaAI integration, make sure to set up your environment variables:

```
LUMAAI_API_KEY=your_lumaai_api_key_here
```

## Usage

### Initializing the Service

To start the LumaAI service, use the following code:

```typescript
// services.ts
import Restack from "@restackio/ai";
import { lumaaiService } from "@restackio/integrations-lumaai";

export async function services() {
  const client = new Restack();
  lumaaiService({ client }).catch((err) => {
    console.error("Error starting LumaAI service:", err);
  });
}

services().catch((err) => {
  console.error("Error running services:", err);
});
```

### Available Functions

This integration provides the following functions:

1. `lumaaiGenerate`: Generate content using LumaAI.
2. `lumaaiGetGeneration`: Retrieve a specific generation by ID.
3. `lumaaiListGenerations`: List all generations.

#### Generate Content

```typescript
// generateContent.ts
import { log, step } from "@restackio/workflow";
import * as lumaaiFunctions from "@restackio/integrations-lumaai/functions";
import { lumaaiTaskQueue } from "@restackio/integrations-lumaai/taskQueue";

export async function generateContentWorkflow() {
  const result = await step<typeof lumaaiFunctions>({
    taskQueue: lumaaiTaskQueue,
  }).lumaaiGenerate({
    prompt: "A futuristic cityscape",
    aspectRatio: "16:9",
    loop: false,
    apiKey: "your_api_key", // Optional if set in environment variables
  });
}
```

#### Get Generation

```typescript
// getGeneration.ts
import { log, step } from "@restackio/workflow";
import * as lumaaiFunctions from "@restackio/integrations-lumaai/functions";
import { lumaaiTaskQueue } from "@restackio/integrations-lumaai/taskQueue";

export async function getGenerationWorkflow() {
  const result = await step<typeof lumaaiFunctions>({
    taskQueue: lumaaiTaskQueue,
  }).lumaaiGetGeneration({
    generationId: "generation_id_here",
    apiKey: "your_api_key", // Optional if set in environment variables
  });
}
```

#### List Generations

```typescript
// listGenerations.ts

import { log, step } from "@restackio/workflow";
import * as lumaaiFunctions from "@restackio/integrations-lumaai/functions";
import { lumaaiTaskQueue } from "@restackio/integrations-lumaai/taskQueue";

export async function listGenerationsWorkflow() {
  const result = await step<typeof lumaaiFunctions>({
    taskQueue: lumaaiTaskQueue,
  }).lumaaiListGenerations({
    apiKey: "your_api_key", // Optional if set in environment variables
  });
}
```
npm package: @restackio/integrations-openai
Description: This package provides an integration for OpenAI's API, specifically tailored for use with the Restack AI framework.
Latest version: 0.0.34

# @restackio/integrations-openai

This package provides an integration for OpenAI's API, specifically tailored for use with the Restack AI framework.

## Installation

To install the package, use npm or yarn:

```bash
npm install @restackio/integrations-openai
```

## Features

- OpenAI Chat Completions (base and streaming)
- Rate limiting support
- Cost calculation
- Tool calls handling
- Event streaming

## Usage

### Basic Setup

```typescript
// services.ts
import Restack from "@restackio/ai";
import { openaiService } from "@restackio/integrations-openai";

export async function services() {
  const client = new Restack();
  openaiService({ client, options: { rateLimit: 1000 } }).catch((err) => {
    console.error("Error starting OpenAi service:", err);
  });
}

services().catch((err) => {
  console.error("Error running services:", err);
});
```

### Chat Completions

For basic chat completions:

```typescript
// openaiChatCompletionsBase.ts

import { log, step } from "@restackio/ai/workflow";
import * as openaiFunctions from "@restackio/integrations-openai/functions";
import { openaiTaskQueue } from "@restackio/integrations-openai/taskQueue";

export async function openaiChatCompletionsBaseWorkflow() {
  const response = await step<typeof openaiFunctions>({
    taskQueue: openaiTaskQueue,
  }).openaiChatCompletionsBase({
    userContent: "Hello, how are you?",
    model: "gpt-4",
    apiKey: "your-api-key-here",
  });
}
```

For streaming chat completions:

```typescript
// streamingChatCompletions.ts

import { log, step } from "@restackio/ai/workflow";
import * as openaiFunctions from "@restackio/integrations-openai/functions";
import { openaiTaskQueue } from "@restackio/integrations-openai/taskQueue";

export async function streamingChatsCompletionsWorkflow() {
  const response = await step<typeof openaiFunctions>({
    taskQueue: openaiTaskQueue,
  }).openaiChatCompletionsStream({
    newMessage: "Tell me a story",
    model: "gpt-4",
    streamAtCharacter: ".",
    streamEvent: {
      workflowEventName: "story_chunk",
    },
    apiKey: "your-api-key-here",
  });
}
```

## Configuration

The package uses environment variables for configuration. Make sure to set:

- `OPENAI_API_KEY`: Your OpenAI API key
npm package: @restackio/integrations-resend
Description: This package provides an integration for Resend's email services within the Restack AI framework.
Latest version: 0.0.3

# Restack Resend Integration

This package provides an integration for Resend's email services within the Restack AI framework.

## Installation

To install the Resend integration, use npm or yarn:

```bash
npm install @restackio/integrations-resend
```

## Configuration

Before using the Resend integration, make sure to set up your Resend API key. You can do this by setting the `RESEND_API_KEY` environment variable or by passing the API key directly to the client.

## Usage

### Initializing the Resend Service

To start the Resend service:

```typescript
// services.ts
import Restack from "@restackio/ai";
import { resendService } from "@restackio/integrations-resend";

export async function services() {
  const client = new Restack();
  resendService({ client }).catch((err) => {
    console.error("Error starting Resend service:", err);
  });
}

services().catch((err) => {
  console.error("Error running services:", err);
});
```

### Available Functions

This integration provides the main function:

1. `resendSendEmail`: Send emails using Resend

#### Sending Emails

```typescript
// sendEmailWorkflow.ts
import { log, step } from "@restackio/ai/workflow";
import * as resendFunctions from "@restackio/integrations-resend/functions";
import { resendTaskQueue } from "@restackio/integrations-resend/taskQueue";

export async function sendEmailWorkflow() {
  const result = await step<typeof resendFunctions>({
    taskQueue: resendTaskQueue,
  }).resendSendEmail({
    payload: {
      to: "recipient@example.com",
      subject: "Hello from Resend",
      body: "This is a test email.",
    },
  });
  log.info("result", { result });
}
```
npm package: @restackio/integrations-slack
Description: This package provides an integration for Slack with Restack, allowing:
Latest version: 0.0.5

# Slack for Restack

This package provides an integration for Slack with Restack, allowing:

- the posting of messages to [conversations](https://api.slack.com/surfaces/messages#conversations)

## Installation

To install the package, use npm or yarn:

```bash
npm install @restackio/integrations-slack
```

## Configuration

Before using the Slack integration you need to set up your Slack Bot User OAuth token. You can do this by setting an environment variable or passing it directly to the functions.

1. Set up environment variables:

```bash
SLACK_TOKEN=your_slack_bot_user_oauth_token
```

2. Or pass them directly when calling the functions (see Usage section).

## Usage

### Starting the Slack Service

To start the Slack service, use the `slackService` function:

```typescript
import Restack from "@restackio/ai";
import { slackService } from "@restackio/integrations-slack";

const client = new Restack();

slackService({ client }).catch((err) => {
  console.error("Error starting Slack service:", err);
});
```

### Using the Slack Post Message Function

This function allows the posting of messages to [conversations](https://api.slack.com/).

In order to use this function your Slack Bot User OAuth token must have one of these scopes:

- `bot`
- `chat:bot:write`
- `chat:user:write`

```typescript
import { postMessage } from "@restackio/integrations-slack/functions";

const result = await postMessage({
  blocks, // optional
  conversationId: "your_conversation_id", // Can be a channel ID, a DM ID, a MPDM ID, or a group ID
  mrkdwn, // defaults to true
  text: "Hello World!",
  token: "your_slack_bot_user_oauth_token", // Optional if set in environment variables
});

console.log(result);
```
npm package: @restackio/integrations-twilio
Description: This package provides a Twilio integration for Restack, allowing you to easily incorporate Twilio functionality into your Restack-powered applications.
Latest version: 0.0.10

# @restackio/integrations-twilio

This package provides a Twilio integration for Restack, allowing you to easily incorporate Twilio functionality into your Restack-powered applications.

## Installation

To install the package, use npm or yarn:

```bash
npm install @restackio/integrations-twilio
```

## Usage

### Setting up the Twilio Service

To use the Twilio integration, you need to set up the Twilio service in your application:

```typescript
// services.ts
import Restack from "@restackio/ai";
import { twilioService } from "@restackio/integrations-twilio";

export async function services() {
  const client = new Restack();
  twilioService({
    client,
    options: {
      rateLimit: 1, // Adjust as needed
    },
  }).catch((err) => {
    console.error("Error starting Twilio service:", err);
  });
}

services().catch((err) => {
  console.error("Error running services:", err);
});
```

### Making a Twilio Call

You can use the `twilioCall` function to initiate a call inside one of your workflows:

```typescript
// twilioCall.ts

import { log, step } from "@restackio/ai/workflow";
import * as twilioFunctions from "@restackio/integrations-twilio/functions";
import { twilioTaskQueue } from "@restackio/integrations-twilio/taskQueue";

export async function twilioCallWorkflow() {
  const result = await step<typeof twilioFunctions>({
    taskQueue: twilioTaskQueue,
  }).twilioCall({
    accountSid: "YOUR_ACCOUNT_SID",
    authToken: "YOUR_AUTH_TOKEN",
    options: {
      to: "+1234567890",
      from: "+0987654321",
      url: "http://example.com/twiml",
    },
  });
  log.info("Call SID:", result.sid);
}
```

## Configuration

Make sure to set the following environment variables:

- `TWILIO_ACCOUNT_SID`: Your Twilio Account SID
- `TWILIO_AUTH_TOKEN`: Your Twilio Auth Token

You can also pass these credentials directly to the `twilioCall` function if needed.

## Available Functions

- `twilioCall`: Initiates a Twilio call

## Task Queue

The Twilio integration uses a dedicated task queue named "twilio" for processing Twilio-related tasks.

## Rate Limiting

The Twilio service is configured with a default rate limit of 1 request per second. You can adjust this in the `twilioService` options if needed, but be mindful of [Twilio's rate limits](https://help.twilio.com/articles/223180028).
npm package: @restackio/integrations-websocket
Description: This package provides WebSocket integration for Restack, allowing you to easily incorporate WebSocket functionality into your Restack workflows.
Latest version: 0.0.17

# @restackio/integrations-websocket

This package provides WebSocket integration for Restack, allowing you to easily incorporate WebSocket functionality into your Restack workflows.

## Installation

To install the package

```bash
npm install @restackio/integrations-websocket
```

## Usage

### Importing the Service

To use the WebSocket service in your Restack application, import it as follows:

```typescript
// services.ts
import Restack from "@restackio/ai";
import { websocketService } from "@restackio/integrations-websocket";

export async function services() {
  const client = new Restack();
  websocketService({ client }).catch((err) => {
    console.error("Error starting Websocket service:", err);
  });
}

services().catch((err) => {
  console.error("Error running services:", err);
});
```

### Available Functions

This package provides two main functions:

1. `websocketListen`: Listens for WebSocket events and triggers corresponding workflow events.
2. `websocketSend`: Sends events through a WebSocket connection.

#### websocketListen

```typescript
websocketListen({
  streamSid: string,
  events?: {
  websocketEventName: string,
  workflowEventName: string,
  workflow?: SendWorkflowEvent["workflow"]
  }[],
  address?: string
})
```

#### websocketSend

```typescript
websocketSend({
  name: string,
  input: WebsocketEvent,
  address: string,
});
```