open-index/open-npm huggingface dataset:
npm package: @microfox/slack
Description: This package provides a lightweight, proxy interface to the official Slack Web API, offering a curated set of the most commonly used functions for building Slack integrations. It is designed to be simple, efficient, and easy to integrate into your project
Latest version: 1.2.10

# @microfox/slack

This package provides a lightweight, proxy interface to the official Slack Web API, offering a curated set of the most commonly used functions for building Slack integrations. It is designed to be simple, efficient, and easy to integrate into your projects.

## Installation

```bash
npm install @microfox/slack
```

## Usage

To use this package, import the `MicrofoxSlackClient` and initialize it with your Slack API token.

```typescript
import { MicrofoxSlackClient } from '@microfox/slack';

const token = process.env.SLACK_ACCESS_TOKEN;
const slackClient = new MicrofoxSlackClient(token);

// Example: Send a message to a channel
(async () => {
  const channelId = 'C12345678';
  const res = await slackClient.messageChannel({ channelId: channelId, text: 'Hello there' });
  console.log('Message sent: ', res.ts);
})();
```
npm package: @microfox/slack-oauth
Description: A TypeScript OAuth package for Slack.
Latest version: 1.3.0

# Microfox Slack OAuth

A TypeScript OAuth package for Slack.

## Installation

```bash
npm install @microfox/slack-oauth @microfox/slack-oauth
```

## Environment Variables

To use this package, you need to set the following environment variables:

- `SLACK_CLIENT_ID`: Your Slack app's Client ID. ** (Required)**
- `SLACK_CLIENT_SECRET`: Your Slack app's Client Secret. ** (Required)**
- `SLACK_REDIRECT_URI`: The redirect URI you configured for your Slack app. ** (Required)**
- `SCOPES`: The scopes for your Slack app. ** (Required)**
- `USER_SCOPES`: The user scopes for your slack app.

## API Reference

For detailed documentation on the constructor and all available functions, please refer to the following files:

- [**SlackOAuthSdk** (Constructor)](./docs/SlackOAuthSdk.md): Initializes the client.
- [getAuthorizationUrl](./docs/getAuthorizationUrl.md)
- [exchangeCodeForToken](./docs/exchangeCodeForToken.md)
- [validateToken](./docs/validateToken.md)
- [revokeToken](./docs/revokeToken.md)
npm package: @microfox/slack-web-tiny
Description: Slack Web Tiny SDK for Microfox
Latest version: 1.5.0

# Slack Web Tiny SDK

A lightweight, type-safe SDK for interacting with the Slack Web API.

## Installation

```bash
npm install @microfox/slack-web-tiny
```

## Usage

```typescript
import { createSlackSDK } from '@microfox/slack-web-tiny';

// Initialize the SDK with your Slack bot token
const slackSDK = createSlackSDK({
  botToken: process.env.SLACK_BOT_TOKEN ?? 'xoxb-your-bot-token',
  authType: 'header',
  baseUrl: 'https://slack.com/api',
});
```

## API Reference

### `createSlackSDK(config: SlackSDKConfig)`

Creates a new instance of the Slack SDK.

#### Config Options

- `botToken` (string, required): Your Slack bot user OAuth token
- `authType` ('header' | 'query', optional): Authentication method (defaults to 'header')
- `baseUrl` (string, optional): Override the default Slack API URL (defaults to 'https://slack.com/api')

## Error Handling

The SDK uses Zod for runtime type validation and will throw errors if:

- The message payload doesn't match the expected schema
- The API response doesn't match the expected schema
- The API request fails

Example:

```typescript
try {
  const response = await slackSDK.sendMessage({
    channel: 'C1234567890', // Channel ID
    text: 'Hello world',
  });
  console.log('Message sent:', response);
} catch (error) {
  console.error('Failed to send message:', error);
}
```