From e3c223ebac307bb8cb1b05017969443ff25657e2 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Wed, 14 Oct 2026 13:33:06 -0400 Subject: [PATCH] feat: add the user_connections feature to the app manifest types --- .changeset/manifest-user-connections.md | 5 ++ .../web-api/src/types/request/manifest.ts | 15 ++++++ .../web-api/test/types/methods/apps.test-d.ts | 53 +++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 .changeset/manifest-user-connections.md diff --git a/.changeset/manifest-user-connections.md b/.changeset/manifest-user-connections.md new file mode 100644 index 000000000..f78962638 --- /dev/null +++ b/.changeset/manifest-user-connections.md @@ -0,0 +1,5 @@ +--- +"@slack/web-api": minor +--- + +feat: add the `user_connections` feature (`is_enabled`, `auth_hosts`) to the app manifest types diff --git a/packages/web-api/src/types/request/manifest.ts b/packages/web-api/src/types/request/manifest.ts index 05bb110a8..d8f7b6122 100644 --- a/packages/web-api/src/types/request/manifest.ts +++ b/packages/web-api/src/types/request/manifest.ts @@ -83,6 +83,11 @@ interface ManifestFeatures { * @see {@link https://docs.slack.dev/messaging/unfurling-links-in-messages Link unfurling: configuring domains}. */ unfurl_domains?: string[]; + /** + * @description A subgroup of settings that opt the app into the standardized user connection flow, where users + * connect the app to an account on an external provider. + */ + user_connections?: ManifestUserConnections; } interface ManifestAgentView { @@ -189,6 +194,16 @@ interface ManifestSlashCommand { usage_hint?: string; } +interface ManifestUserConnections { + /** @description Whether the user connection flow is enabled for the app. */ + is_enabled: boolean; + /** + * @description An array of hosts, without a scheme, that the provider's `auth_url` and `disconnect_url` may use. + * Subdomains of a listed host are also allowed. Between 1 and 25 hosts can be included in this array. + */ + auth_hosts: string[]; +} + interface ManifestOAuthConfig { /** * @description An array of strings containing {@link https://docs.slack.dev/authentication/installing-with-oauth OAuth redirect URLs}. diff --git a/packages/web-api/test/types/methods/apps.test-d.ts b/packages/web-api/test/types/methods/apps.test-d.ts index 3260a3c61..31eca1731 100644 --- a/packages/web-api/test/types/methods/apps.test-d.ts +++ b/packages/web-api/test/types/methods/apps.test-d.ts @@ -24,6 +24,32 @@ expectAssignable>([ // -- sad path expectError(web.apps.manifest.create()); // lacking argument expectError(web.apps.manifest.create({})); // empty argument +expectError( + web.apps.manifest.create({ + manifest: { + display_information: { name: 'Connector' }, + features: { + user_connections: { + // missing is_enabled + auth_hosts: ['example.com'], + }, + }, + }, + }), +); +expectError( + web.apps.manifest.create({ + manifest: { + display_information: { name: 'Connector' }, + features: { + user_connections: { + // missing auth_hosts + is_enabled: true, + }, + }, + }, + }), +); expectError( web.apps.manifest.create({ manifest: { @@ -75,6 +101,33 @@ expectAssignable>([ }, }, ]); +// -- happy path: user_connections +expectAssignable>([ + { + manifest: { + display_information: { name: 'Connector' }, + features: { + user_connections: { + is_enabled: true, + auth_hosts: ['example.com', 'auth.example.com'], + }, + }, + }, + }, +]); +expectAssignable>([ + { + manifest: { + display_information: { name: 'Connector' }, + features: { + user_connections: { + is_enabled: false, + auth_hosts: ['example.com'], + }, + }, + }, + }, +]); // apps.manifest.delete // -- sad path