Skip to content

feat: Add plugin to list squadup tickets#41

Open
bcbogdan wants to merge 3 commits into
mainfrom
feat/squadup
Open

feat: Add plugin to list squadup tickets#41
bcbogdan wants to merge 3 commits into
mainfrom
feat/squadup

Conversation

@bcbogdan
Copy link
Copy Markdown
Collaborator

@bcbogdan bcbogdan commented May 15, 2026

Adds a SquadUp integration endpoint that lists the tickets for a user. The route is meant to be used together with the Rownd JS SDK to list the available tickets for an authenticated user.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 15, 2026

🦋 Changeset detected

Latest commit: d80fbd2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@supertokens-plugins/squadup-nodejs Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@bcbogdan bcbogdan requested a review from porcellus May 17, 2026 10:40
session: RequiredSuperTokensSession,
userContext?: SuperTokensUserContext,
): Promise<string | undefined> {
const user = await SuperTokens.getUser(session.getUserId(), userContext);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we include this in the token or cache this somehow to avoid a server lookup on every request?

}

const pageSize = Number(rawPageSize);
if (!Number.isInteger(pageSize) || pageSize <= 0) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably set a max as well.

Comment on lines +143 to +145
const isFutureTicket =
typeof ticketStart === "string" &&
new Date(ticketStart).getTime() > Date.now() + ticketAvailabilityWindowMs;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this apply to all tickets?

throw new Error("defaultPageSize must be a positive integer");
}

const ticketAvailabilityWindowMs =
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be a customizable function instead that knows some things about the event?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default should definitely be a simple number, though.


export const { logDebugMessage, enableDebugLogs } = buildLogger(
PLUGIN_ID,
PLUGIN_SDK_VERSION,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be the plugin version instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants