{"record":{"id":"12dbbce98f3c60ef","repo":"mastra-ai/mastra","slug":"slackprovider-is-not-configured-provide-a-refresh","errorCode":null,"errorMessage":"SlackProvider is not configured. Provide a refreshToken via the constructor or call configure({ refreshToken }) first.\nGet your tokens at: https://api.slack.com/apps > \"Your App Configuration Tokens\"","messagePattern":"SlackProvider is not configured\\. Provide a refreshToken via the constructor or call configure\\((.+?)\\) first\\.\nGet your tokens at: https://api\\.slack\\.com/apps > \"Your App Configuration Tokens\"","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"channels/slack/src/provider.ts","lineNumber":1315,"sourceCode":"      name: 'Slack',\n      isConfigured: this.isConfigured(),\n    };\n  }\n\n  /**\n   * Check if the provider has credentials and can create/manage Slack apps.\n   * Returns false if no refresh token has been provided via constructor, `configure()`, or storage.\n   */\n  isConfigured(): boolean {\n    return !!this.#manifestClient;\n  }\n\n  /**\n   * Get the manifest client, throwing if the provider isn't configured.\n   */\n  #requireManifestClient(): SlackManifestClient {\n    if (!this.#manifestClient) {\n      throw new Error(\n        'SlackProvider is not configured. Provide a refreshToken via the constructor or call configure({ refreshToken }) first.\\n' +\n          'Get your tokens at: https://api.slack.com/apps > \"Your App Configuration Tokens\"',\n      );\n    }\n    return this.#manifestClient;\n  }\n\n  /**\n   * Get the SlackAdapter for an installation.\n   * Used internally for message formatting and posting.\n   */\n  getAdapter(installationId: string): SlackAdapter | undefined {\n    return this.#adapters.get(installationId);\n  }\n\n  // ===========================================================================\n  // Route Handlers\n  // ===========================================================================","sourceCodeStart":1297,"sourceCodeEnd":1333,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/channels/slack/src/provider.ts#L1297-L1333","documentation":"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).","triggerScenarios":"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 }).","commonSituations":"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.","solutions":["Call provider.configure({ refreshToken }) before using manifest APIs.","Pass the refreshToken in the SlackProvider constructor: new SlackProvider({ refreshToken }).","Verify the token is an App Configuration Token from https://api.slack.com/apps (Your App Configuration Tokens), not a bot token.","Ensure configure() is actually reached (check early returns/guards) in the code path that uses the manifest client."],"exampleFix":"// before\nconst provider = new SlackProvider();\nawait provider.updateManifest(manifest);\n// after\nconst provider = new SlackProvider({ refreshToken: process.env.SLACK_REFRESH_TOKEN });\nawait provider.updateManifest(manifest);","handlingStrategy":"validation","validationCode":"if (!process.env.SLACK_REFRESH_TOKEN) {\n  throw new Error('SLACK_REFRESH_TOKEN is required before using Slack manifest APIs');\n}\nprovider.configure({ refreshToken: process.env.SLACK_REFRESH_TOKEN });","typeGuard":null,"tryCatchPattern":"try {\n  await provider.updateManifest(manifest);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('not configured')) {\n    provider.configure({ refreshToken: process.env.SLACK_REFRESH_TOKEN });\n  } else throw e;\n}","preventionTips":["Always construct SlackProvider with a refreshToken in a shared factory/factory function.","Fail fast at boot: assert the refresh token exists before wiring routes.","Use App Configuration Tokens from api.slack.com, not bot tokens."],"tags":["slack","configuration","missing-credentials"],"backgroundTag":"provider-not-configured","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}