Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 61 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,101 @@ This is a blank [Bolt for JavaScript](https://docs.slack.dev/tools/bolt-js/) tem

## Setup

Before getting started, make sure you have a development workspace where you have permissions to install apps. If you dont have one setup, go ahead and [create one](https://slack.com/create).
Before getting started, make sure you have a development workspace where you have permissions to install apps. If you don't have one setup, go ahead and [create one](https://slack.com/create).

### Developer Program

Join the [Slack Developer Program](https://api.slack.com/developer-program) for exclusive access to sandbox environments for building and testing your apps, tooling, and resources created to help you build and grow.

## Installation

### Create a Slack App
<details><summary><strong>Using Slack CLI</strong></summary>

Install the latest version of the Slack CLI for your operating system:

- [Slack CLI for macOS & Linux](https://docs.slack.dev/tools/slack-cli/guides/installing-the-slack-cli-for-mac-and-linux/)
- [Slack CLI for Windows](https://docs.slack.dev/tools/slack-cli/guides/installing-the-slack-cli-for-windows/)

You'll also need to log in if this is your first time using the Slack CLI.

```sh
slack login
```

Comment on lines +22 to +27

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪓 note: Same changes for slack-samples/bolt-python-starter-template#80

#### Initializing the project

```sh
slack create my-bolt-js-app --template slack-samples/bolt-js-blank-template
cd my-bolt-js-app
```

After cloning, you're all set to start developing!

</details>

<details><summary><strong>Using Terminal</strong></summary>

#### Create Your Slack App

1. Open [https://api.slack.com/apps/new](https://api.slack.com/apps/new) and choose "From an app manifest"
2. Choose the workspace you want to install the application to
3. Copy the contents of [manifest.json](./manifest.json) into the text box that says `*Paste your manifest code here*` (within the JSON tab) and click _Next_
4. Review the configuration and click _Create_
5. You'll be redirected to the app settings page for your app. Click _Install App_ in the left hand menu then _Install to Workspace_ and _Allow_ on the screen that follows.
5. Click _Install to Workspace_ and _Allow_ on the screen that follows. You'll then be redirected to the App Configuration dashboard.

#### Environment Variables

Before you can run the app, you'll need to gather some environment variables.
Before you can run the app, you'll need to store some environment variables.

1. **Bot token**: Open your [app settings](https://api.slack.com/apps) page, click _OAuth & Permissions_ in the left hand menu, then copy the _Bot User OAuth Token_.
2. **App token**: Click _Basic Information_ from the left hand menu and follow the steps in the _App-Level Tokens_ section to create an app-level token with the `connections:write` scope.
1. Rename `.env.sample` to `.env`
2. Open your apps configuration page from [this list](https://api.slack.com/apps), click _OAuth & Permissions_ in the left hand menu, then copy the _Bot User OAuth Token_ into your `.env` file under `SLACK_BOT_TOKEN`
3. Click _Basic Information_ from the left hand menu and follow the steps in the _App-Level Tokens_ section to create an app-level token with the `connections:write` scope. Copy that token into your `.env` as `SLACK_APP_TOKEN`.

Once you have these, export both in a shell for following processes:
#### Initializing the project

```sh
export SLACK_BOT_TOKEN=xoxb-example
export SLACK_APP_TOKEN=xapp-1-example
git clone https://github.com/slack-samples/bolt-js-blank-template.git my-bolt-js-app
cd my-bolt-js-app
```

### Setup Your Local Project
#### Install dependencies

```sh
# Clone this project onto your machine
git clone https://github.com/slack-samples/bolt-js-blank-template.git
npm install
```

# Change into this project directory
cd bolt-js-blank-template
</details>

# Install dependencies
npm install
## Development

# Run Bolt server
npm start
```
### Starting the app

At this point a message should appear in the terminal that notes the Bolt app is running! It doesn't do much else at the moment.
#### Slack CLI

```sh
slack run
```

#### Linting
#### Terminal

```sh
npm start
```

### Linting

```zsh
# Run lint for code formatting and linting
npm run lint
```

### Testing

```zsh
# Run test for unit tests
npm test
```

## Resources

To learn more about developing Slack apps, visit the following pages:
Expand Down