Skip to main content

Overview

Blink ships with pre-built SDK packages that provide ready-to-use tools for common integrations. These SDKs give your agents powerful capabilities out of the box—from building Slack bots to interacting with GitHub repositories to searching the web to executing commands on a computer. Each SDK is a separate npm package that you can install and use in your agent. The tools are built on the Vercel AI SDK and integrate seamlessly with Blink’s agent framework.

Available SDKs

Slack SDK

Package: @blink-sdk/slack The Slack SDK provides tools and utilities for building Slack bots with Blink. It handles webhook integration, message formatting, and Slack API interactions, making it easy to create agents that respond to Slack events.

Key Features

  • Event Handling: Respond to Slack messages, mentions, and reactions
  • Message Formatting: Convert between Blink messages and Slack’s block format
  • Bolt Integration: Built on top of Slack’s official Bolt framework
  • Rich Responses: Support for attachments, blocks, and interactive elements

Installation

npm install @blink-sdk/slack

Basic Usage

This is the agent.ts file that is automatically generated when you select Slackbot during the blink init initialization workflow.
import { convertToModelMessages, streamText } from "ai";
import * as blink from "blink";
import * as slack from "@blink-sdk/slack";
import { App } from "@slack/bolt";

// Create Slack receiver and app
const receiver = new slack.Receiver();
const app = new App({
  token: process.env.SLACK_BOT_TOKEN,
  signingSecret: process.env.SLACK_SIGNING_SECRET,
  receiver,
});

// Handle messages in channels (only when @mentioned)
app.event("app_mention", async ({ event }) => {
  const chat = await agent.chat.upsert([
    "slack",
    event.channel,
    event.thread_ts ?? event.ts,
  ]);
  const { message } = await slack.createMessageFromEvent({
    client: app.client,
    event,
  });
  await agent.chat.sendMessages(chat.id, [message]);
});

// Handle direct messages (always respond)
app.event("message", async ({ event }) => {
  // Ignore bot messages and message changes
  if (event.subtype || event.bot_id) {
    return;
  }
  // Only handle DMs (channel type is 'im')
  const channelInfo = await app.client.conversations.info({
    channel: event.channel,
  });
  if (!channelInfo.channel?.is_im) {
    return;
  }
  const chat = await agent.chat.upsert(["slack", event.channel]);
  const { message } = await slack.createMessageFromEvent({
    client: app.client,
    event,
  });
  await agent.chat.sendMessages(chat.id, [message]);
});

const agent = new blink.Agent();

// Connect Slack events to the agent
agent.on("request", async (request) => {
  return receiver.handle(app, request);
});

// Handle chat messages and generate responses
agent.on("chat", async ({ messages }) => {
  const tools = slack.createTools({ client: app.client });
  return streamText({
    model: blink.model("anthropic/claude-sonnet-4.5"),
    system: "You are a helpful Slack bot assistant.",
    messages: convertToModelMessages(messages, {
      ignoreIncompleteToolCalls: true,
      tools,
    }),
    tools,
  });
});

agent.serve();

GitHub SDK

Package: @blink-sdk/github The GitHub SDK provides comprehensive tools for interacting with GitHub repositories, issues, pull requests, and more. Perfect for building agents that automate code review, manage issues, or monitor CI/CD pipelines.

Key Features

  • Repository Management: Search repositories, read files, list directories, search code
  • Issues & Pull Requests: Create, update, search, and manage issues and PRs
  • Code Review: Read PR diffs, list changed files, create review comments and reactions
  • GitHub Actions: Monitor workflow runs, check job status, read CI logs
  • Commits & Releases: View commit history, get diffs, list releases
  • Organizations & Projects: Manage org projects, list contributors, view project items
  • Check Runs: Create and update GitHub check runs with annotations and status updates

Installation

npm install @blink-sdk/github

Basic Usage

import github from "@blink-sdk/github";
import { convertToModelMessages, streamText } from "ai";
import blink from "blink";

const agent = blink.agent();

agent.on("chat", async ({ messages }) => {
  return streamText({
    model: blink.model("anthropic/claude-sonnet-4"),
    system: "You are a helpful GitHub assistant.",
    messages: convertToModelMessages(messages),
    tools: {
      ...github.tools,
    },
  });
});

agent.serve();

Adding Authentication

import blink from "blink";
import github from "@blink-sdk/github";

// Option 1: Personal access token
blink.tools.withContext(github.tools, {
  accessToken: process.env.GITHUB_TOKEN,
});

// Option 2: GitHub App authentication
blink.tools.withContext(github.tools, {
  appAuth: {
    appId: process.env.GITHUB_APP_ID,
    privateKey: process.env.GITHUB_PRIVATE_KEY,
    installationId: parseInt(process.env.GITHUB_INSTALLATION_ID),
  },
});

// Option 3: Custom Octokit instance
import { Octokit } from "@octokit/core";

blink.tools.withContext(github.tools, {
  octokit: new Octokit({ auth: process.env.GITHUB_TOKEN }),
});

Customizing Tool Descriptions

You can override tool descriptions to guide your agent’s behavior:
tools: {
  ...github.tools,
  create_issue: {
    ...github.tools.create_issue,
    description: "Create a GitHub issue. Never tag users with @ unless explicitly requested.",
  },
}

Available Tools

  • Repository: search_repositories, get_repository, list_repository_contributors
  • Files: repository_read_file, repository_list_directory, repository_grep_file, search_code
  • Issues: search_issues, get_issue, create_issue, update_issue, list_issue_comments, create_issue_comment
  • Pull Requests: get_pull_request, create_pull_request, update_pull_request, list_pull_request_files, get_pull_request_diff
  • Reviews: list_pull_request_reviews, get_pull_request_review, list_pull_request_review_comments, create_pull_request_review_comment_reply
  • Reactions: create_issue_comment_reaction, create_pull_request_review_comment_reaction
  • Commits: list_commits, get_commit, get_commit_diff
  • Releases: list_releases
  • Actions: actions_list_runs, actions_list_jobs, actions_get_job_logs
  • Check Runs: create_check_run, update_check_run, get_check_run, list_check_runs_for_ref
  • Organizations: get_organization, list_organization_projects, list_organization_project_items
  • Users: get_user, list_user_installations, list_app_installations

Web Search SDK

Package: @blink-sdk/web-search The Web Search SDK provides tools for searching the web using Exa, a search engine built for LLMs. Perfect for agents that need to find up-to-date information, research topics, or gather data from the web.

Key Features

  • Semantic Search: AI-powered search that understands context and meaning
  • Content Retrieval: Automatically fetches and returns page content
  • Live Crawling: Optionally crawl pages in real-time for the freshest data
  • Automatic Billing: No Exa API key required when running on Blink Cloud (passthrough billing)

Installation

npm install @blink-sdk/web-search

Basic Usage

import websearch from "@blink-sdk/web-search";
import { convertToModelMessages, streamText } from "ai";
import blink from "blink";

const agent = blink.agent();

agent.on("chat", async ({ messages }) => {
  return streamText({
    model: blink.model("anthropic/claude-sonnet-4"),
    system: "You are a helpful research assistant.",
    messages: convertToModelMessages(messages),
    tools: {
      ...websearch.tools,
    },
  });
});

agent.serve();

Configuration

By default, the SDK uses Blink’s proxy with passthrough billing. To use your own Exa API key:
export EXA_API_KEY=your-exa-api-key

Available Tools

  • web_search: Search the web and retrieve relevant content

Compute SDK

Package: @blink-sdk/compute The Compute SDK provides tools for executing commands and manipulating files on a computer. This gives your agent the ability to run scripts, manage files, search code, and interact with the filesystem—perfect for development and automation agents.

Key Features

  • Command Execution: Run bash commands with full output capture
  • File Operations: Read, write, edit, and search files
  • Process Management: Monitor running processes and read their output
  • Code Search: Grep through files to find specific patterns
  • Safe Editing: Apply precise edits with automatic validation

Installation

npm install @blink-sdk/compute

Basic Usage

import compute from "@blink-sdk/compute";
import { convertToModelMessages, streamText } from "ai";
import blink from "blink";

const agent = blink.agent();

agent.on("chat", async ({ messages }) => {
  return streamText({
    model: blink.model("anthropic/claude-sonnet-4"),
    system: "You are a helpful coding assistant.",
    messages: convertToModelMessages(messages),
    tools: {
      ...compute.tools,
    },
  });
});

agent.serve();

Available Tools

  • Command Execution: execute_bash, execute_bash_sync
  • Process Management: process_wait, process_read_output, process_grep_output, process_list, process_kill
  • File Operations: read_file, write_file, file_edit, list_directory, file_glob, file_grep
  • File Search: glob_search, grep_search

Example: Running Tests

tools: {
  ...compute.tools,
  run_tests: tool({
    description: "Run the test suite for the project",
    inputSchema: z.object({
      testFile: z.string().optional(),
    }),
    execute: async ({ testFile }) => {
      // Use compute tools to run tests
      const command = testFile ? `npm test ${testFile}` : "npm test";
      return await compute.tools.execute_bash_sync.execute({
        command,
        working_directory: ".",
        env: {},
      });
    },
  }),
}

Using Multiple SDKs

You can combine multiple SDKs in a single agent to create powerful, multi-functional agents:
import slack from "@blink-sdk/slack";
import github from "@blink-sdk/github";
import websearch from "@blink-sdk/web-search";
import compute from "@blink-sdk/compute";
import { convertToModelMessages, streamText } from "ai";
import blink from "blink";

const agent = blink.agent();

agent.on("chat", async ({ messages }) => {
  return streamText({
    model: blink.model("anthropic/claude-sonnet-4"),
    system:
      "You are a helpful development assistant with access to Slack, GitHub, web search, and local compute.",
    messages: convertToModelMessages(messages),
    tools: {
      ...slack.tools,
      ...github.tools,
      ...websearch.tools,
      ...compute.tools,
    },
  });
});

agent.serve();

Customizing SDK Tools

All SDK tools can be customized to fit your needs:

Override Descriptions

tools: {
  ...github.tools,
  create_issue: {
    ...github.tools.create_issue,
    description: "Create a GitHub issue. Only use when explicitly asked.",
  },
}

Add Context

// Add authentication or configuration to tools
blink.tools.withContext(github.tools, {
  accessToken: process.env.GITHUB_TOKEN,
});

Require Approval

tools: {
  // Safe tools run without approval
  ...github.tools.search_repositories,
  ...github.tools.get_repository,

  // Destructive tools require manual approval
  ...blink.tools.withApproval({
    messages,
    tools: {
      create_issue: github.tools.create_issue,
      create_pull_request: github.tools.create_pull_request,
    },
  }),
}

Tips for Using SDKs

Start with the basics: Don’t add every tool to your agent. Start with a few relevant tools and add more as needed. Use specific descriptions: Override tool descriptions to guide your agent’s behavior and prevent unwanted actions. Add authentication carefully: Store API tokens in environment variables and never commit them to version control. Combine SDKs thoughtfully: Multiple SDKs can make your agent more powerful, but too many tools can confuse the model. Require approval for destructive actions: Use blink.tools.withApproval for tools that create, update, or delete resources. Test locally first: Always test your agent locally before deploying to ensure tools work as expected.
I