Skip to content

Commit

Permalink
fix: add missing type declaration for SLACK_TARGETS (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekremney authored Jan 26, 2024
1 parent ede7f01 commit 1658513
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
12 changes: 12 additions & 0 deletions packages/spacecat-shared-rum-api-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ npm install @adobe/spacecat-shared-rum-api-client

## Usage

### Configuring Tokens

To configure tokens for your application, follow these steps:

1. Visit the main page of your Slack app at [https://api.slack.com/apps](https://api.slack.com/apps).

2. Navigate to the "OAuth & Permissions" page and locate the "Scope" section. Here, you can add scopes to your Slack app based on the specific methods you intend to use from the Slack API. For example, if your app requires file upload functionality, ensure you add the `files:read` and `files:write` scopes.

3. Locate your Slack bot token under the "Bot User OAuth Token" section on the same page. You will need to provide this token to the `SlackClient` in your application.

4. For information on the scopes needed for each Slack API method, refer to the [documentation](https://api.slack.com/methods). The required scopes for each API method are listed in the "Bot tokens" row. As an example, to use the `postMessage` API method, the required scope is `chat:write`, as documented in [https://api.slack.com/methods/chat.postMessage](https://api.slack.com/methods/chat.postMessage).

### Creating and instance from Helix UniversalContext

```js
Expand Down
7 changes: 6 additions & 1 deletion packages/spacecat-shared-slack-client/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@

import { UniversalContext } from '@adobe/helix-universal';

export default class SlackClient {
export declare const SLACK_TARGETS: {
ADOBE_INTERNAL: string;
ADOBE_EXTERNAL: string;
};

export class SlackClient {
/**
* Static factory method to create an instance of SlackClient.
* @param {UniversalContext} context - An object containing the AWS Lambda context information
Expand Down

0 comments on commit 1658513

Please sign in to comment.