Skip to content

Single sign-on (SSO)

With single sign-on, people use their account in your app. Nobody makes a FeedbackOtter account or password.

Only your real customers can vote, comment and post ideas. And you see who asked for what: their name, email, plan and revenue.

It works in two places:

  • The widget inside your app.
  • Your board, the public site for your ideas, roadmap and changelog.
  1. Your server signs a short token for the logged-in user, with your secret.
  2. You give the token to the widget, or send the user to your board with it.
  3. FeedbackOtter checks the signature and signs them in.

The token is a standard JWT signed with HS256. Any JWT library can make one.

In the dashboard, go to Settings → Single sign-on. Click Reveal, then copy the secret.

Settings, Single sign-on tab: the secret (hidden), with Reveal and Replace secret buttons, and a token example.

Store it on your server as an environment variable. The examples below use FEEDBACKOTTER_SSO_SECRET.

Each product has its own secret.

A token holds a few facts about the user, called claims.

Claim Required What it is
sub Yes Your user’s ID, as a string. Up to 200 characters. Never changes.
name Yes Their name. Up to 100 characters.
exp Yes When the token expires, in seconds since 1970. At most 24 hours ahead.
email No Their email address. Used for notifications.
mrr No Their monthly revenue, in US dollars. A number, like 249.5.
company No Their company’s name. Up to 100 characters.
plan No Their plan, like "Business". Up to 60 characters.
signed_up_at No When they joined your app, in seconds since 1970.
attributes No Up to 20 of your own fields. See Custom attributes.

A token with every claim:

{
"sub": "123",
"name": "Ada Lopez",
"email": "ada@example.com",
"mrr": 249.5,
"company": "Acme Inc",
"plan": "Business",
"signed_up_at": 1767225600,
"attributes": { "role": "admin", "seats": 12, "beta": true },
"exp": 1795174696
}
  • Sign with HS256. Other algorithms are rejected.
  • sub must be a string: "123", not 123.
  • exp is in seconds, not milliseconds.
  • Extra claims, like iat, are ignored.

Email, revenue, company, plan, sign-up date and attributes are only shown to your team. Use them to pick who sees a survey. On the Business plan and up, you can also sort ideas by the revenue behind them.

Send your own facts about a user in attributes:

"attributes": { "role": "admin", "seats": 12, "beta": true, "renews_on": "2026-12-01" }
  • Keys start with a letter. Then letters, numbers and _. Up to 40 characters.
  • Values are text (up to 200 characters), numbers, or true/false.
  • Dates go in as text, like "2026-12-01".
  • Up to 20 attributes. The rest are ignored.

Anything else, like a nested object or null, is skipped. It doesn’t stop the sign-in.

Pick your language. Every example signs the same token, and each one was tested against FeedbackOtter.

// npm install jsonwebtoken
import jwt from "jsonwebtoken";
const token = jwt.sign(
{ sub: String(user.id), name: user.name, email: user.email },
process.env.FEEDBACKOTTER_SSO_SECRET,
{ algorithm: "HS256", expiresIn: "1h" },
);

Sign a new token for each page view or sign-in. Don’t store tokens or share them between users.

Put the token in the embed code as token. Render it into the page on your server:

<script>
// …the rest of your embed code…
FeedbackOtter.init({
publicKey: "pk_…",
token: "<%= feedback_otter_token %>", // from your server, per page view
});
</script>

Get the embed code from Widgets → Feedback widget. See Install the widget.

When someone signs in without a page reload, pass a fresh token to identify:

const { token } = await fetch("/api/feedbackotter-token").then((r) => r.json());
FeedbackOtter.identify(token);

When they sign out, clear it:

FeedbackOtter.identify(null);

Your /api/feedbackotter-token route signs a token for the current user, as in step 3.

The widget sends the token with every request. When it expires, the widget goes read-only and logs why in the console.

If people keep a tab open for hours, call identify with a new token before the old one expires.

init tells you whether the user is signed in:

const { signedIn, reason } = await FeedbackOtter.init({ publicKey: "pk_…", token });
// signedIn: true, or false with a reason

Your board has a Sign in button. It sends people to a page in your app, called the login URL.

A board, signed out, with a Sign in button and a 'Sign in to vote and post' banner.
  1. Someone clicks Sign in on your board.
  2. Your board sends them to your login URL, with ?redirect=/the/page/they/were/on.
  3. Your app makes sure they’re logged in, then signs a token.
  4. Your app sends them to https://<your-board>/sso?token=…&redirect=….
  5. They’re back on the same page, signed in, for 30 days.

In Settings → Single sign-on, enter your login URL and click Save.

Step 3, Tell the board where to sign in: a login URL field with a Save button.

Until you set one, the board has no Sign in button. It tells visitors to use the Feedback button in your app instead.

The endpoint checks they’re logged in, signs a token and redirects. Set FEEDBACKOTTER_BOARD_URL to your board’s address, like https://acme.feedbackotter.app. If your board has a custom domain, use that instead.

Express:

import express from "express";
import jwt from "jsonwebtoken";
const app = express();
app.get("/feedback-login", (req, res) => {
if (!req.user) {
// Log in first, then come back here.
return res.redirect(`/login?next=${encodeURIComponent(req.originalUrl)}`);
}
const token = jwt.sign(
{ sub: String(req.user.id), name: req.user.name, email: req.user.email },
process.env.FEEDBACKOTTER_SSO_SECRET,
{ algorithm: "HS256", expiresIn: "5m" },
);
const redirect = typeof req.query.redirect === "string" ? req.query.redirect : "/";
res.redirect(
`${process.env.FEEDBACKOTTER_BOARD_URL}/sso?token=${token}&redirect=${encodeURIComponent(redirect)}`,
);
});

A 5-minute expiry is enough here. The token is used once, straight away.

Once signed in, the board shows their name:

The board header showing 'Signed in as Ada Lopez' and a Sign out link.

On the Single sign-on tab, click Generate a test token.

  • Copy token: paste it as token in your embed code, on a test page.
  • Open your board as Test user: see your board signed in.

The test token signs you in as “Test user” for one hour. Don’t ship it.

  • Sign tokens on your server. Never in the browser.
  • Keep the secret in an environment variable or secrets manager.
  • Only sign a token for a user who is logged in to your app.
  • Keep tokens short: 5 minutes for the board, up to an hour for the widget.
  • Pass the redirect value through as it is. The board only follows paths on itself.
  • If the secret leaks, replace it.

When a token is rejected, the board shows why:

Error page: We couldn't sign you in. The sign-in token has expired.

The widget stays read-only and logs the same reason in the browser console:

[FeedbackOtter] The sign-in token was rejected (…); continuing signed out, read-only.
Message What to check
The sign-in token is not a valid HS256 JWT with sub, name and exp. The algorithm is HS256. sub is a string. name and exp are there. email is a real address. Fields are within their limits.
The sign-in token’s signature does not match this board’s secret. You’re using this product’s secret, and it hasn’t been replaced. No spaces or newlines around it.
The sign-in token has expired. Sign a new token for each page view. Check your server’s clock.
The sign-in token’s exp is more than 24 hours away. exp must be in seconds. Date.now() is in milliseconds: divide by 1000.

No Sign in button on your board? Set your login URL in Settings → Single sign-on.

Signed in on the board, but not in the widget (or the other way round)? They’re separate. The widget needs token in the embed code. The board needs the login URL.

Do I need to create users in FeedbackOtter first? No. A person is created the first time they sign in.

I added someone by hand before they signed in. What happens? Their first sign-in with the same email takes over that record. Votes you added for them stay theirs.

Can a user change their email or name? Yes. Send the new details in their next token. sub is what identifies them, so keep it the same.

How do people sign out? On the board, with Sign out. In the widget, call FeedbackOtter.identify(null) when they sign out of your app.

I have several products. Do they share a secret? No. Each product has its own secret and login URL.