mastra-ai/mastra · error

SlackProvider is not configured. Provide a refreshToken via

Error message

SlackProvider is not configured. Provide a refreshToken via the constructor or call configure({ refreshToken }) first.
Get your tokens at: https://api.slack.com/apps > "Your App Configuration Tokens"

What it means

SlackProvider lazily creates a SlackManifestClient only after being configured with an app configuration refreshToken. #requireManifestClient throws this when a manifest-related API is called before configure() ran or the constructor received a refreshToken. The message includes where to obtain the token (api.slack.com/apps > Your App Configuration Tokens).

Source

Thrown at channels/slack/src/provider.ts:1315

      name: 'Slack',
      isConfigured: this.isConfigured(),
    };
  }

  /**
   * Check if the provider has credentials and can create/manage Slack apps.
   * Returns false if no refresh token has been provided via constructor, `configure()`, or storage.
   */
  isConfigured(): boolean {
    return !!this.#manifestClient;
  }

  /**
   * Get the manifest client, throwing if the provider isn't configured.
   */
  #requireManifestClient(): SlackManifestClient {
    if (!this.#manifestClient) {
      throw new Error(
        'SlackProvider is not configured. Provide a refreshToken via the constructor or call configure({ refreshToken }) first.\n' +
          'Get your tokens at: https://api.slack.com/apps > "Your App Configuration Tokens"',
      );
    }
    return this.#manifestClient;
  }

  /**
   * Get the SlackAdapter for an installation.
   * Used internally for message formatting and posting.
   */
  getAdapter(installationId: string): SlackAdapter | undefined {
    return this.#adapters.get(installationId);
  }

  // ===========================================================================
  // Route Handlers
  // ===========================================================================

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Call provider.configure({ refreshToken }) before using manifest APIs.
  2. Pass the refreshToken in the SlackProvider constructor: new SlackProvider({ refreshToken }).
  3. Verify the token is an App Configuration Token from https://api.slack.com/apps (Your App Configuration Tokens), not a bot token.
  4. Ensure configure() is actually reached (check early returns/guards) in the code path that uses the manifest client.

Example fix

// before
const provider = new SlackProvider();
await provider.updateManifest(manifest);
// after
const provider = new SlackProvider({ refreshToken: process.env.SLACK_REFRESH_TOKEN });
await provider.updateManifest(manifest);
Defensive patterns

Strategy: validation

Validate before calling

if (!process.env.SLACK_REFRESH_TOKEN) {
  throw new Error('SLACK_REFRESH_TOKEN is required before using Slack manifest APIs');
}
provider.configure({ refreshToken: process.env.SLACK_REFRESH_TOKEN });

Try / catch

try {
  await provider.updateManifest(manifest);
} catch (e) {
  if (e instanceof Error && e.message.includes('not configured')) {
    provider.configure({ refreshToken: process.env.SLACK_REFRESH_TOKEN });
  } else throw e;
}

Prevention

When it happens

Trigger: Calling any manifest API (e.g. creating/updating the Slack app manifest) on a SlackProvider constructed without a refreshToken and never configured via configure({ refreshToken }).

Common situations: Forgetting to pass MASTRA-style Slack refresh token in a new environment; constructing the provider in one place and calling configure in a code path that never executes; using a legacy token type instead of an app configuration token.

Related errors


AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30). Data as JSON: /api/errors/12dbbce98f3c60ef. Report an issue: GitHub.