Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: new URL (HOLD) #2253

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
[![codecov](https://codecov.io/gh/slackapi/bolt-js/branch/main/graph/badge.svg?token=x4oCgiexvp)](https://codecov.io/gh/slackapi/bolt-js)
[![Node.js CI](https://github.com/slackapi/bolt-js/actions/workflows/ci-build.yml/badge.svg)](https://github.com/slackapi/bolt-js/actions/workflows/ci-build.yml)

A JavaScript framework to build Slack apps in a flash with the latest platform features. Read the [getting started guide](https://slack.dev/bolt-js/tutorial/getting-started) to set-up and run your first Bolt app.
A JavaScript framework to build Slack apps in a flash with the latest platform features. Read the [getting started guide](https://tools.slack.dev/bolt-js/tutorial/getting-started) to set-up and run your first Bolt app.

Read [the documentation](https://slack.dev/bolt-js) to explore the basic and advanced concepts of Bolt for JavaScript.
Read [the documentation](https://tools.slack.dev/bolt-js) to explore the basic and advanced concepts of Bolt for JavaScript.

## Setup

Expand Down Expand Up @@ -80,7 +80,7 @@ Most of the app's functionality will be inside listener functions (the `fn` para

| Argument | Description |
| :---: | :--- |
| `payload` | Contents of the incoming event. The payload structure depends on the listener. For example, for an Events API event, `payload` will be the [event type structure](https://api.slack.com/events-api#event_type_structure). For a block action, it will be the action from within the `actions` array. The `payload` object is also accessible via the alias corresponding to the listener (`message`, `event`, `action`, `shortcut`, `view`, `command`, or `options`). For example, if you were building a `message()` listener, you could use the `payload` and `message` arguments interchangeably. **An easy way to understand what's in a payload is to log it**, or [use TypeScript](https://slack.dev/bolt-js/tutorial/using-typescript). |
| `payload` | Contents of the incoming event. The payload structure depends on the listener. For example, for an Events API event, `payload` will be the [event type structure](https://api.slack.com/events-api#event_type_structure). For a block action, it will be the action from within the `actions` array. The `payload` object is also accessible via the alias corresponding to the listener (`message`, `event`, `action`, `shortcut`, `view`, `command`, or `options`). For example, if you were building a `message()` listener, you could use the `payload` and `message` arguments interchangeably. **An easy way to understand what's in a payload is to log it**, or use TypeScript. |
| `say` | Function to send a message to the channel associated with the incoming event. This argument is only available when the listener is triggered for events that contain a `channel_id` (the most common being `message` events). `say` accepts simple strings (for plain-text messages) and objects (for messages containing blocks). `say` returns a promise that will resolve with a [`chat.postMessage` response](https://api.slack.com/methods/chat.postMessage).
| `ack` | Function that **must** be called to acknowledge that an incoming event was received by your app. `ack` exists for all actions, shortcuts, view, slash command and options requests. `ack` returns a promise that resolves when complete. Read more in [Acknowledging events](#acknowledging-events)
| `client` | Web API client that uses the token associated with that event. For single-workspace installations, the token is provided to the constructor. For multi-workspace installations, the token is returned by the `authorize` function.
Expand All @@ -107,7 +107,7 @@ app.message(async ({ message, say }) => {

### Calling the Web API

In addition to the [`client` property passed to listeners](#making-things-happen), each app has a top-level `client` that can be used to call methods. Unlike the `client` passed to listeners, the top-level client must be passed a `token`. [Read the documentation](https://slack.dev/bolt-js/concepts#web-api) for more details.
In addition to the [`client` property passed to listeners](#making-things-happen), each app has a top-level `client` that can be used to call methods. Unlike the `client` passed to listeners, the top-level client must be passed a `token`. [Read the documentation](https://tools.slack.dev/bolt-js/concepts#web-api) for more details.

### Acknowledging events

Expand All @@ -129,7 +129,7 @@ Depending on the type of incoming event a listener is meant for, `ack()` should

## Getting Help

[The documentation](https://slack.dev/bolt-js) has more information on basic and advanced concepts for Bolt for JavaScript.
[The documentation](https://tools.slack.dev/bolt-js) has more information on basic and advanced concepts for Bolt for JavaScript.

If you otherwise get stuck, we're here to help. The following are the best ways to get assistance working through your issue:

Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# slack.dev/bolt-js
# tools.slack.dev/bolt-js

This website is built using [Docusaurus](https://docusaurus.io/). 'Tis cool.

Expand Down
24 changes: 12 additions & 12 deletions docs/content/basic/authenticating-oauth.md
Original file line number Diff line number Diff line change
Expand Up @@ -702,30 +702,30 @@ for additional details for common error codes.
[authorization]: /concepts/authorization
[callback-default-failure]: https://github.com/slackapi/node-slack-sdk/blob/e5a4f3fbbd4f6aad9fdd415976f80668b01fd442/packages/oauth/src/callback-options.ts#L127-L162
[callback-default-success]: https://github.com/slackapi/node-slack-sdk/blob/e5a4f3fbbd4f6aad9fdd415976f80668b01fd442/packages/oauth/src/callback-options.ts#L81-L125
[callback-options]: https://slack.dev/node-slack-sdk/reference/oauth/interfaces/CallbackOptions
[callback-options]: https://tools.slack.dev/node-slack-sdk/reference/oauth/interfaces/CallbackOptions
[callback-options-default]: https://github.com/slackapi/node-slack-sdk/blob/e5a4f3fbbd4f6aad9fdd415976f80668b01fd442/packages/oauth/src/callback-options.ts#L81-L162
[callbacks]: https://slack.dev/node-slack-sdk/reference/oauth/interfaces/CallbackOptions
[callbacks]: https://tools.slack.dev/node-slack-sdk/reference/oauth/interfaces/CallbackOptions
[custom-routes]: /concepts/custom-routes
[direct-install]: https://github.com/slackapi/bolt-js/blob/5b4d9ceb65e6bf5cf29dfa58268ea248e5466bfb/examples/oauth/app.js#L58-L64
[errors]: https://api.slack.com/authentication/oauth-v2#errors
[examples]: https://github.com/slackapi/bolt-js/tree/main/examples/oauth
[generate-install-url]: https://slack.dev/node-slack-sdk/oauth/#using-handleinstallpath
[generate-install-url]: https://tools.slack.dev/node-slack-sdk/oauth/#using-handleinstallpath
[install-provider-options]: https://github.com/slackapi/node-slack-sdk/blob/main/packages/oauth/src/install-provider-options.ts
[installation-page]: https://slack.dev/node-slack-sdk/oauth/#showing-an-installation-page
[installation-store]: https://slack.dev/node-slack-sdk/reference/oauth/interfaces/InstallationStore
[installation-page]: https://tools.slack.dev/node-slack-sdk/oauth/#showing-an-installation-page
[installation-store]: https://tools.slack.dev/node-slack-sdk/reference/oauth/interfaces/InstallationStore
[installation-store-file]: https://github.com/slackapi/node-slack-sdk/blob/main/packages/oauth/src/installation-stores/file-store.ts
[oauth-node]: https://slack.dev/node-slack-sdk/oauth
[oauth-node]: https://tools.slack.dev/node-slack-sdk/oauth
[oauth-v2]: https://api.slack.com/authentication/oauth-v2
[oidc]: https://slack.dev/node-slack-sdk/web-api#sign-in-with-slack-via-openid-connect
[oidc]: https://tools.slack.dev/node-slack-sdk/web-api#sign-in-with-slack-via-openid-connect
[org-ready]: https://api.slack.com/enterprise/org-ready-apps
[org-ready-oauth]: https://api.slack.com/enterprise/org-ready-apps#oauth
[scopes]: https://api.slack.com/scopes
[settings]: https://api.slack.com/apps
[siws]: https://api.slack.com/authentication/sign-in-with-slack
[state]: https://slack.dev/node-slack-sdk/oauth#using-a-custom-state-store
[state-store]: https://slack.dev/node-slack-sdk/reference/oauth/interfaces/StateStore
[state]: https://tools.slack.dev/node-slack-sdk/oauth#using-a-custom-state-store
[state-store]: https://tools.slack.dev/node-slack-sdk/reference/oauth/interfaces/StateStore
[state-store-clear]: https://github.com/slackapi/node-slack-sdk/blob/main/packages/oauth/src/state-stores/clear-state-store.ts
[store]: https://slack.dev/node-slack-sdk/oauth#storing-installations-in-a-database
[store]: https://tools.slack.dev/node-slack-sdk/oauth#storing-installations-in-a-database
[user-tokens]: https://api.slack.com/concepts/token-types#user
[verification]: https://slack.dev/node-slack-sdk/oauth#state-verification
[web-api]: https://slack.dev/node-slack-sdk/web-api
[verification]: https://tools.slack.dev/node-slack-sdk/oauth#state-verification
[web-api]: https://tools.slack.dev/node-slack-sdk/web-api
4 changes: 2 additions & 2 deletions docs/content/basic/web-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ lang: en
slug: /concepts/web-api
---

You can call [any Web API method](https://api.slack.com/methods) using the [`WebClient`](https://slack.dev/node-slack-sdk/web-api) provided to your app's listeners as `client`. This uses either the token that initialized your app **or** the token that is returned from the [`authorize`](/concepts/authorization) function for the incoming event. The built-in [OAuth support](/concepts/authenticating-oauth) handles the second case by default.
You can call [any Web API method](https://api.slack.com/methods) using the [`WebClient`](https://tools.slack.dev/node-slack-sdk/web-api) provided to your app's listeners as `client`. This uses either the token that initialized your app **or** the token that is returned from the [`authorize`](/concepts/authorization) function for the incoming event. The built-in [OAuth support](/concepts/authenticating-oauth) handles the second case by default.

Your Bolt app also has a top-level `app.client` which you can manually pass the `token` parameter. If the incoming request is not authorized or you're calling a method from outside of a listener, use the top-level `app.client`.

Calling one of the [`WebClient`](https://slack.dev/node-slack-sdk/web-api)'s methods will return a Promise containing the response from Slack, regardless of whether you use the top-level or listener's client.
Calling one of the [`WebClient`](https://tools.slack.dev/node-slack-sdk/web-api)'s methods will return a Promise containing the response from Slack, regardless of whether you use the top-level or listener's client.

Since the introduction of [org wide app installations](https://api.slack.com/enterprise/apps), [some web-api methods](https://api.slack.com/enterprise/apps/changes-apis#methods) now require `team_id` to indicate which workspace to act on. Bolt for JavaScript will attempt to infer the `team_id` based on incoming payloads and pass it along to `client`. This is handy for existing applications looking to add support for org wide installations and not spend time updating all of these web-api calls.

Expand Down
8 changes: 4 additions & 4 deletions docs/content/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ App options are passed into the `App` constructor. When the `receiver` argument
| Option | Description |
| :--- | :--- |
| `receiver` | An instance of `Receiver` that parses and handles incoming events. Must conform to the [`Receiver` interface](/concepts/receiver), which includes `init(app)`, `start()`, and `stop()`. More information about receivers is [in the documentation](/concepts/receiver). |
| `agent` | Optional HTTP `Agent` used to set up proxy support. Read more about custom agents in the [Node Slack SDK documentation](https://slack.dev/node-slack-sdk/web-api#proxy-requests-with-a-custom-agent). |
| `agent` | Optional HTTP `Agent` used to set up proxy support. Read more about custom agents in the [Node Slack SDK documentation](https://tools.slack.dev/node-slack-sdk/web-api#proxy-requests-with-a-custom-agent). |
| `clientTls` | Optional `string` to set a custom TLS configuration for HTTP client requests. Must be one of: `"pfx"`, `"key"`, `"passphrase"`, `"cert"`, or `"ca"`. |
| `convoStore` | A store to set and retrieve state-related conversation information. `set()` sets conversation state and `get()` fetches it. By default, apps have access to an in-memory store. More information and an example can be found [in the documentation](/concepts/conversation-store). |
| `token` | A `string` from your app's configuration (under "Settings" > "Install App") required for calling the Web API. May not be passed when using `authorize`, `orgAuthorize`, or OAuth. |
Expand All @@ -147,7 +147,7 @@ App options are passed into the `App` constructor. When the `receiver` argument

:::info

Bolt's client is an instance of `WebClient` from the [Node Slack SDK](https://slack.dev/node-slack-sdk), so some of that documentation may be helpful as you're developing.
Bolt's client is an instance of `WebClient` from the [Node Slack SDK](https://tools.slack.dev/node-slack-sdk), so some of that documentation may be helpful as you're developing.

:::

Expand All @@ -172,11 +172,11 @@ You can find the code for error definition and construction within [errors.ts](h
:::

### Client errors
Bolt imports a `WebClient` to call Slack's APIs. Below is a set of errors you may encounter when making API calls with the client, though you can read more [in the web API documentation](https://slack.dev/node-slack-sdk/web-api#handle-errors). When handling client errors, more information can be found in the body within the `data` property.
Bolt imports a `WebClient` to call Slack's APIs. Below is a set of errors you may encounter when making API calls with the client, though you can read more [in the web API documentation](https://tools.slack.dev/node-slack-sdk/web-api#handle-errors). When handling client errors, more information can be found in the body within the `data` property.

| Error code | Details |
| :--- | :--- |
| `PlatformError` | Error received when calling a Slack API. Includes a `data` property. |
| `RequestError` | A request could not be sent, perhaps because your network connection is not available. It has an `original` property with more details. |
| `RateLimitedError` | Your app has made too many requests too quickly. Includes a `retryAfter` property with the number of seconds you should wait before trying to send again. The `WebClient` will handle rate limit errors by default–[you can read more in the documentation](https://slack.dev/node-slack-sdk/web-api#rate-limits). |
| `RateLimitedError` | Your app has made too many requests too quickly. Includes a `retryAfter` property with the number of seconds you should wait before trying to send again. The `WebClient` will handle rate limit errors by default–[you can read more in the documentation](https://tools.slack.dev/node-slack-sdk/web-api#rate-limits). |
| `HTTPError` | The HTTP response contained an unfamiliar status code. The Web API only responds with `200` (including for errors), or `429` for rate limiting. |
2 changes: 1 addition & 1 deletion docs/content/tutorial/hubot-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The [Events API](https://api.slack.com/bot-users#app-mentions-response) is a bot

:::info

Before you configure your bot’s events, you’ll need a public URL. If you’ve never created a Bolt for JavaScript app or never used the Events API, it’d be helpful to go through [setting up your local Bolt project](/getting-started) and [setting up events](https://slack.dev/getting-started#setting-up-events) in the Getting Started guide.
Before you configure your bot’s events, you’ll need a public URL. If you’ve never created a Bolt for JavaScript app or never used the Events API, it’d be helpful to go through [setting up your local Bolt project](/getting-started) and [setting up events](https://tools.slack.dev/getting-started#setting-up-events) in the Getting Started guide.

:::

Expand Down
18 changes: 9 additions & 9 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const config = {
tagline: 'Official frameworks, libraries, and SDKs for Slack developers',
favicon: 'img/favicon.ico',

url: 'https://slack.dev',
url: 'https://tools.slack.dev',
baseUrl: '/bolt-js/',
organizationName: 'slackapi',
projectName: 'bolt-js',
Expand Down Expand Up @@ -86,7 +86,7 @@ plugins:
logo: {
alt: 'Slack logo',
src: 'img/slack-logo.svg',
href: 'https://slack.dev',
href: 'https://tools.slack.dev',
target : '_self'
},
items: [
Expand All @@ -97,17 +97,17 @@ plugins:
items: [
{
label: 'Java',
to: 'https://slack.dev/java-slack-sdk/guides/bolt-basics',
to: 'https://tools.slack.dev/java-slack-sdk/guides/bolt-basics',
target: '_self',
},
{
label: 'JavaScript',
to: 'https://slack.dev/bolt-js',
to: 'https://tools.slack.dev/bolt-js',
target: '_self',
},
{
label: 'Python',
to: 'https://slack.dev/bolt-python',
to: 'https://tools.slack.dev/bolt-python',
target: '_self',
},
]
Expand All @@ -119,17 +119,17 @@ plugins:
items: [
{
label: 'Java Slack SDK',
to: 'https://slack.dev/java-slack-sdk/',
to: 'https://tools.slack.dev/java-slack-sdk/',
target: '_self',
},
{
label: 'Node Slack SDK',
to: 'https://slack.dev/node-slack-sdk/',
to: 'https://tools.slack.dev/node-slack-sdk/',
target: '_self',
},
{
label: 'Python Slack SDK',
to: 'https://slack.dev/python-slack-sdk/',
to: 'https://tools.slack.dev/python-slack-sdk/',
target: '_self',
},
{
Expand All @@ -146,7 +146,7 @@ plugins:
items: [
{
label: 'Community tools',
to: 'https://slack.dev/community-tools',
to: 'https://tools.slack.dev/community-tools',
target: '_self',
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/i18n/ja-jp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ For example:
},
```

Be careful changing `code.json`. If you change something in this repo, it will likely need to be changed in the other Slack.dev repos too, like the Bolt-Python repo. We want these translations to match for all Slack.dev sites.
Be careful changing `code.json`. If you change something in this repo, it will likely need to be changed in the other tools.slack.dev repos too, like the Bolt-Python repo. We want these translations to match for all tools.slack.dev sites.
Loading