-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e4cf49
commit 34283ed
Showing
2 changed files
with
55 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |