Skip to content

Commit

Permalink
feat: add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
elisalimli committed Mar 3, 2024
1 parent 5e4cf49 commit 34283ed
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 1,7 @@
SLACK_BOT_TOKEN =
SLACK_SIGNING_SECRET =
SLACK_APP_TOKEN =

SUPERAGENT_API_KEY =
SUPERAGENT_API_BASE_URL = http://localhost:8000/api/v1
SUPERAGENT_API_BASE_URL = https://api.beta.superagent.sh/api/v1
SUPERAGENT_WORKFLOW_ID =
SUPERAGENT_AGENT_ID =
60 changes: 54 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 1,56 @@
# Getting started with TypeScript ⚡️ Bolt for JavaScript
> TypeScript equivalent for Slack app example from 📚 [Getting started with Bolt for JavaScript tutorial][1]
## SuperBot for Slack

This is a temporary example app intending to show how to work with Bolt's type system. Because the type system is currently lacking,
this app will change in the future. See [#826][2] for more context.
This project is a Slack bot that leverages SuperAgent AI. It's built with TypeScript and deployed using AWS lambda functions (you can deploy it to anywhere by building the docker container).

[1]: https://slack.dev/bolt-js/tutorial/getting-started
[2]: https://github.com/slackapi/bolt-js/issues/826

## Deploying (Step-by-step guide)

#### Clone this repository.
```bash
git clone https://github.com/superagent-ai/slack-bot
```

#### Install the dependencies
```bash
npm install
```

#### Copy the .env.example file and rename it to .env:
```bash
cp .env.example .env
```

##### You will need to fill these environment variables
- ```SUPERAGENT_AGENT_ID```: The ID of your Superagent ID or ```SUPERAGENT_WORKFLOW_ID``` The ID of your workflow.
- ```SUPERAGENT_API_BASE_URL```: The base URL for the SuperAgent API.
- ```SLACK_SIGNING_SECRET```: Your Slack app's signing secret.
- ```SLACK_BOT_TOKEN```: Your Slack app's bot token.

#### Superagent environment variables
- Go to [Superagent workflows page](https://beta.superagent.sh/workflows)
- Create your workflow
- Copy the ID and set ```WORKFLOW_ID``` to that ID.
- Go to [Superagent's API Keys page](https://beta.superagent.sh/settings/api-keys)
- Create a new key & Replace it with ```SUPERAGENT_API_KEY```

#### Slack environment variables
- Go to [Slack API page](https://api.slack.com/apps?new_app=1)
- Click `From an app manifest` button
- Select workspace
- Copy `manifest.yaml` file and paste it to Slack's editor
- Go to `Basic Information`
- Copy Signing Secret and set `SLACK_SIGNING_SECRET` to that in .env
- Go to `OAuth & Permissions`
- Click `Install to Workspace`
- Copy `User OAuth Token` and set `SLACK_BOT_TOKEN` to that

## Deployment
1. Install serverles
```bash
npm install -g serverless
```

2. Deploy
```bash
serverless deploy
```

0 comments on commit 34283ed

Please sign in to comment.