Getting Started

Getting Started with Web Action SDK

To start using the Web Action SDK, you'll need to install it in your project and obtain an API key. Here's a quick guide to get you up and running:

Installation

Install the SDK using your package manager of choice:

pnpm i @actionbase/web-action-sdk

Setting Up Your API Key

Store your API key in a secure place. We recommend creating a .env file and importing it with the dotenv package:

  1. Create a .env file:
pnpm add dotenv
touch .env
  1. Add your API key to the .env file:
ACTIONBASE_API_KEY=your-api-key

Using the SDK

Now you can import the SDK package and instantiate it in your code:

import { Sdk } from "@actionbase/web-action-sdk";
import "dotenv/config";
 
const sdk = new Sdk(process.env.ACTIONBASE_API_KEY!);

Your First Action

Let's try sending a LinkedIn connection request:

const results = await sdk.linkedin.sendConnectionRequest({
  to: "John Doe",
  note: "Hello from the Web Action SDK!"
});

Once the connection is accepted, you can send a message:

const results = await sdk.linkedin.sendMessage({
  to: "John Doe",
  message: "Hi John, this is a test of the Actionbase Web Action SDK! 👋"
});

Congratulations! 👏 You've just performed your first actions with the Web Action SDK. Explore the rest of the documentation to learn more about the available platforms and actions.