A TypeScript app built with Bolt for JavaScript that demonstrates Work Objects in Slack. This example shows how to:
- Unfurl links with rich Work Object metadata
- Display interactive details in the flexpane
- Support editing work object fields directly from Slack
This app responds to links being shared in Slack with Work Object metadata to display rich link previews. Users can click the preview to view detailed information in the flexpane, and edit supported fields like description and status.
Read the Work Objects documentation to learn more!
- Go to https://api.slack.com/apps
- Click "Create New App"
- Choose "From an app manifest"
- Select your workspace
- Copy the contents of
manifest.jsonand paste it into the manifest editor - Review the configuration and click "Create"
-
Copy the environment variables template:
cp .env.sample .env
-
Fill in your Slack credentials in
.env:SLACK_BOT_TOKEN=xoxb-your-bot-token SLACK_APP_TOKEN=xapp-your-app-tokenYou can find these values in your app's settings:
- Bot Token: OAuth & Permissions → Bot User OAuth Token
- App Token: Basic Information → App-Level Tokens (create one with
connections:writescope)
npm installnpm start- Make sure you've added the domain used for the sample URLs in metadata.ts to the unfurl domains in App Settings
- Verify that the
link_sharedevent is enabled in Event Subscriptions - Check that your app has the
links:readandlinks:writescopes - Ensure Socket Mode is enabled and you have a valid app-level token with
connections:writescope - Verify the app is running (
⚡️ The Work Objects app is running!should appear in console)
- Ensure the
entity_details_requestedevent is enabled in Event Subscriptions - Check that your app is connected via Socket Mode
- Look for errors in the app logs
- Ensure Interactivity is enabled in your app settings
- Check that the
view_submissionhandler is receiving events (check logs) - Verify the entity has editable fields defined with
edit: { enabled: true }
- ✅ Link unfurling with
EntityMetadata - ✅ Flexpane display with
entity.presentDetails - ✅ Field editing via
view_submission - ✅ Support for both File and Task entity types
- ✅ TypeScript with strict typing using
@slack/types - ✅ Socket Mode for local development
- Work Objects Documentation - Official Slack docs
- Entity Types Reference - Available entity types
- Bolt for JavaScript - Framework documentation
- @slack/types - TypeScript type definitions
MIT