---
url: https://relizy.dev/config/social.md
description: >-
  Options of the release posts on Twitter (X), Slack and Microsoft Teams -
  enabling, prereleases, templates and their variables, credentials, Slack
  format and length, Teams cards and announcements.
---

# {{ $frontmatter.title }}

{{ $frontmatter.description }}

Setup of the platforms, shape of the posts and troubleshooting: [Social Media](./../guide/social-media.md). In `relizy release`, the posts also need [`release.social`](./release.md#steps) (`true` by default). The credentials can come from the environment or from [`tokens`](./overview.md#tokens).

```ts
import { defineConfig } from 'relizy'

export default defineConfig({
  social: {
    changelogUrl: 'https://my-lib.dev/changelog',
    twitter: { enabled: true },
    slack: { enabled: true, changelog: 'full' },
    teams: { enabled: true, cards: 'release' },
  },
})
```

## twitter

### enabled {#twitter-enabled}

* **Type:** `boolean`
* **Default:** `false`

Post the releases on Twitter (X). Requires `twitter-api-v2`.

### onlyStable {#twitter-onlystable}

* **Type:** `boolean`
* **Default:** `true`

Do not announce the prereleases (`alpha`, `beta`, `rc`...). A post announcing several versions leaves its prereleases out, and nothing is posted when every version is a prerelease. A release of prereleases only (`--prerelease`, `--prepatch`, `--preminor`, `--premajor`) does not check the credentials of the platform either.

### template {#twitter-template}

* **Type:** `string`
* **Default:** [`templates.twitterMessage`](#templates): '📣 {{releaseTitle}}\n\n{{changelog}}\n\n{{releaseUrl}}\n{{changelogUrl}}'

Text of the tweet, with the [template variables](#template-variables). {{changelog}} gets the space the rest of the template leaves within `postMaxLength`.

### postMaxLength {#twitter-postmaxlength}

* **Type:** `number`
* **Default:** `280`

Maximum length of the tweet, counted as X counts it: a URL counts 23 characters, an emoji or a CJK character counts 2.

### credentials {#twitter-credentials}

* **Type:** `{ apiKey?: string, apiKeySecret?: string, accessToken?: string, accessTokenSecret?: string }`
* **Default:** [`tokens.twitter`](./overview.md#tokens), read from the environment

The `apiKey`, `apiKeySecret`, `accessToken` and `accessTokenSecret` of the X app. Each field set here overrides the one of `tokens.twitter`.

### exclude {#twitter-exclude}

* **Type:** `{ groups?: string[], packages?: string[] }`

Versions left out of the tweet: the [version groups](./monorepo.md#groups) by name, the packages by name or glob (`@scope/*`). Nothing is posted when every version is left out.

## slack

### enabled {#slack-enabled}

* **Type:** `boolean`
* **Default:** `false`

Post the releases on Slack, through a webhook or a bot token.

### onlyStable {#slack-onlystable}

* **Type:** `boolean`
* **Default:** `true`

Same as [`twitter.onlyStable`](#twitter-onlystable).

### webhookUrl {#slack-webhookurl}

* **Type:** `string`
* **Default:** `RELIZY_SLACK_WEBHOOK_URL`, else `SLACK_WEBHOOK_URL`

[Incoming Webhook](https://api.slack.com/messaging/webhooks) of the channel. When a webhook URL is set, it is used even if a token is set (the token and `channel` are ignored, with a warning), and `@slack/web-api` is not needed.

### channel {#slack-channel}

* **Type:** `string`

Channel of the bot token mode, by name (`#releases`) or by ID (`C1234567890`). Required in this mode, ignored with a webhook.

### credentials {#slack-credentials}

* **Type:** `{ token?: string }`
* **Default:** [`tokens.slack`](./overview.md#tokens), read from the environment

`token`: the Bot User OAuth Token (`xoxb-...`), with the `chat:write` scope. Requires `@slack/web-api` and `channel`.

### changelog {#slack-changelog}

* **Type:** `'full' | 'summary' | 'none' | false`

* **Default:** `'summary'`

* **CLI:** `--slack-format <format>` of `relizy social` and `relizy release`

* `full`: the commit bodies (following [`changelog.includeCommitBody`](./changelog.md#includecommitbody)) and the PR and issue links, as Slack rich text, cut to the limits of Slack.

* `summary`: the commit titles, in a single mrkdwn block.

* `none` (or `false`): no changelog, the buttons of the message link to it.

Named `changelogFormat` before relizy 2, see the [migration guide](./../guide/migration-v2.md#changelog-of-the-posts).

### postMaxLength {#slack-postmaxlength}

* **Type:** `number`
* **Default:** `2500` in `summary` format, no limit in `full` format

Maximum length of the changelog in the message. Beyond, `summary` drops the last commits, `full` cuts the changelog where the limit is reached (even inside a commit body); the commits left out are announced with an "… and N more changes" line. In `summary` format, a block never exceeds the 3000 characters of Slack.

### template {#slack-template}

* **Type:** `string`
* **Default:** [`templates.slackMessage`](#templates) (none: the message is made of rich blocks)

Text of the message, in Slack mrkdwn (`*bold*`, `<url|text>`), with the [template variables](#template-variables). The message is then a single block of at most 3000 characters. Without template, the header of the rich blocks is 📣 {{releaseTitle}}.

### noAuthors {#slack-noauthors}

* **Type:** `boolean`
* **Default:** `false`

Hide the contributors on Slack. The global `noAuthors` hides them everywhere, whatever this option.

### noPackages {#slack-nopackages}

* **Type:** `boolean`
* **Default:** `false`

Hide the block listing the released packages with their old and new versions.

### announcements {#slack-announcements}

* **Type:** `({ group: string } | { package: string } & { title?, message?, changelogUrl?, links? })[]`

The versions to announce and their texts, as [`teams.announcements`](#teams-announcements). Without it, every version is announced and the message is unchanged. With it, only the versions matching an entry, each with:

* `title`: replaces the name of the version (its version stays shown): the title of its section, the name of its package line, or the header `📣 <title> <version> is out!` for a single version.
* `message`: markdown, under the title.
* the links **📖 Release notes**, **📝 Changelog** (`changelogUrl`, `false` removes it) and `links`, under the message. For a single version, they replace the buttons **📦 View Release** and **📋 Full Changelog**.

The texts and the links take the [announcement variables](#announcement-variables). With a [`template`](#slack-template), only the title applies to a single version, through {{releaseTitle}}. See [Announcements on Slack](./../guide/social-media.md#announcements-on-slack).

### exclude {#slack-exclude}

* **Type:** `{ groups?: string[], packages?: string[] }`

Versions never announced on Slack, even when an entry of `announcements` matches them: the groups by name, the packages by name or glob. Nothing is posted when every version is left out.

## teams

The cards posted to a Teams workflow. Setup of the workflow: [Microsoft Teams](./../guide/social-media.md#microsoft-teams).

### enabled {#teams-enabled}

* **Type:** `boolean`
* **Default:** `false`

Post the releases on Teams.

### onlyStable {#teams-onlystable}

* **Type:** `boolean`
* **Default:** `true`

Same as [`twitter.onlyStable`](#twitter-onlystable).

### webhookUrl {#teams-webhookurl}

* **Type:** `string`
* **Default:** `RELIZY_TEAMS_WEBHOOK_URL`, else `TEAMS_WEBHOOK_URL`, else the base64 of `RELIZY_TEAMS_WEBHOOK_URL_B64`, else of `TEAMS_WEBHOOK_URL_B64`

URL of the workflow, with the trigger **When a Teams webhook request is received**. It holds a secret (its `sig` parameter): prefer the environment. The URLs of the retired Office 365 connectors are refused.

### cards {#teams-cards}

* **Type:** `'version' | 'release'`

* **Default:** `'version'`

* `version`: one card per version, the root version of a `unified`/`selective` group and each package of an `independent` group.

* `release`: one card for the release, with a section per version under the title of its group.

### changelog {#teams-changelog}

* **Type:** `'full' | 'summary' | 'none' | false`

* **Default:** `'none'`

* `full`: the changelog of the version, the commit bodies included.

* `summary`: the titles of the commits of the version, rewritten with [`ai.social.teams`](./ai.md#social).

* `none` (or `false`): no changelog in the card, its buttons link to it.

A card is at most 28 KB: the changelogs of a card share what its other texts leave, each one cut between two changes with an `… and N more changes` line.

### title {#teams-title}

* **Type:** `string`
* **Default:** {{name}} {{newVersion}}

Title of the card (of its section with `cards: 'release'`), with the [announcement variables](#announcement-variables).

### message {#teams-message}

* **Type:** `string`
* **Default:** A new version of **{{name}}** is available.

Text under the title, in markdown (bold, italic, links, lists), with the [announcement variables](#announcement-variables).

### changelogUrl {#teams-changelogurl}

* **Type:** `string | false`
* **Default:** [`social.changelogUrl`](#changelogurl), else the `CHANGELOG.md` of the version at its tag

URL of the **📝 Changelog** button, with the [announcement variables](#announcement-variables). `false` removes the button.

### links {#teams-links}

* **Type:** `{ title: string, url: string }[]`

Buttons added after **📖 Release notes** and **📝 Changelog**, with the [announcement variables](#announcement-variables) in their title and URL. A button whose URL is empty is left out.

```ts
links: [{ title: '🎨 Storybook', url: 'https://{{shortName}}.acme.dev' }]
```

### badge {#teams-badge}

* **Type:** `string | false`
* **Default:** `'New release'` (`'Prerelease'` for a prerelease)

Text of the badge above the title; `false` removes it.

### locale {#teams-locale}

* **Type:** `string`
* **Default:** `'en-US'`

Locale of the date of the card (`fr-FR` gives `6 novembre 2026`).

### announcements {#teams-announcements}

* **Type:** `({ group: string } | { package: string } & { title?, message?, changelogUrl?, links? })[]`

The versions to announce and their texts. Without it, every version is announced with the options above. With it, only the versions matching an entry:

* `{ group }`: the versions of a [version group](./monorepo.md#groups), its root version or each of its packages when it is `independent`.
* `{ package }`: the packages whose name matches the glob (`@scope/*`), and the version of a project without monorepo under its name. Its fields override the ones of its group entry, field by field.

The fields of an entry override the ones of `social.teams`. See [Announcements](./../guide/social-media.md#announcements).

### exclude {#teams-exclude}

* **Type:** `{ groups?: string[], packages?: string[] }`

Versions never announced, even when an entry of `announcements` matches them: the groups by name, the packages by name or glob.

## Announcement Variables

The texts and the links of the announcements (Teams, and [`slack.announcements`](#slack-announcements)) replace these variables, for each version:

| Variable                            | Value                                                                                              |
| ----------------------------------- | -------------------------------------------------------------------------------------------------- |
| {{name}}         | The package name; the project name (the title of the group with version groups) for a root version |
| {{shortName}}    | `name` without its scope: `ui` for `@acme/ui`                                                      |
| {{newVersion}}   | The version                                                                                        |
| {{tag}}          | Its tag                                                                                            |
| {{groupTitle}}   | The title of its version group, empty without version groups                                       |
| {{projectName}}  | `projectName` of the config, else the name of the root `package.json`                              |
| {{releaseUrl}}   | Its GitHub/GitLab release                                                                          |
| {{changelogUrl}} | The URL of its **📝 Changelog** link                                                               |

## changelogUrl

* **Type:** `string`

URL of the full changelog: {{changelogUrl}} of the templates, the **Full Changelog** button of Slack and the **📝 Changelog** button of Teams. Not set, the variable is empty, and a template line holding only {{changelogUrl}} is removed.

## Templates

`social.twitter.template` falls back to `templates.twitterMessage`, and `social.slack.template` to `templates.slackMessage`: set the `templates` ones to share them between several configs. See [Commit Templates](./commit-templates.md).

## Template Variables

Every occurrence of a variable is replaced. A URL not known is replaced with an empty string, and a line holding only this URL is removed.

| Variable                            | Value                                                                                                                                                                       | Slack only |
| ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| {{releaseTitle}} | `<name> <version> is out!` when a single version is released (the root version, or a single package of an `independent` release), `New releases of <projectName>` otherwise |            |
| {{projectName}}  | `projectName` of the config, else the name of the root `package.json`                                                                                                       |            |
| {{newVersion}}   | The version released, **empty** when several versions are released                                                                                                          |            |
| {{packageList}}  | `name@version` of the released packages, comma-separated                                                                                                                    |            |
| {{packageCount}} | Number of released packages                                                                                                                                                 |            |
| {{changelog}}    | The changelog, fitted to the post; the sections of the versions when several are released                                                                                   |            |
| {{releaseUrl}}   | The GitHub/GitLab release of the only version, else of the `unified`/`selective` group                                                                                      |            |
| {{changelogUrl}} | [`social.changelogUrl`](#changelogurl)                                                                                                                                      |            |
| {{contributors}} | Names of the contributors, one bullet each (empty with `noAuthors`)                                                                                                         | Yes        |
| {{packages}}     | Released packages with their old and new versions, one bullet each (empty with `noPackages`)                                                                                | Yes        |

Use {{releaseTitle}} rather than {{projectName}} {{newVersion}}: it stays right when a release ships several versions.

## Version Groups

A [version group](./monorepo.md#groups) with `release: { social: false }` is left out of the posts. The `social` options are global: one post per platform announces every group (Teams posts a card per version, or one with `cards: 'release'`). The `announcements` of [Teams](#teams-announcements) and [Slack](#slack-announcements) choose the versions and set the texts of each group, `exclude` leaves versions out of Teams, Slack and [Twitter](#twitter-exclude).

```ts
export default defineConfig({
  monorepo: {
    groups: [
      { name: 'main', versionMode: 'selective', packages: ['packages/*'] },
      { name: 'internal', versionMode: 'independent', packages: ['internal/*'], release: { social: false } },
    ],
  },
  social: { slack: { enabled: true } },
})
```
