Skip to content

feat(backend): Add sign ups to Backend API client #5625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 16, 2025
Merged

Conversation

tmilewski
Copy link
Member

Description

Adds the ability to retrieve and update Sign Up Attemps to the Backend API client.

  import { createClerkClient } from '@clerk/backend';

  const clerkClient = createClerkClient(...);

  await clerkClient.signUps.get('signUpAttemptId');
  await clerkClient.signUps.update({...});

ECO-590

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@tmilewski tmilewski self-assigned this Apr 14, 2025
Copy link

changeset-bot bot commented Apr 14, 2025

🦋 Changeset detected

Latest commit: f408a7a

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

This PR includes changesets to release 11 packages
Name Type
@clerk/backend Minor
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/remix Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch

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

Copy link

vercel bot commented Apr 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 15, 2025 5:58pm

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

A new feature has been introduced to support retrieving and updating sign up attempts in the backend API client.

  • Updated exports and JSON interfaces to incorporate SignUpAttempt types.
  • Added a new SignUpAttempt resource class with corresponding deserialization.
  • Introduced a new SignUpAPI endpoint with GET and PATCH methods.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/backend/src/index.ts Updated exports to include SignUpAttempt types.
packages/backend/src/api/resources/index.ts Exported the new SignUpAttempt resource and updated sign up types.
packages/backend/src/api/resources/SignUpAttempt.ts Added the SignUpAttempt resource and JSON conversion logic.
packages/backend/src/api/resources/JSON.ts Updated JSON interfaces to match the new SignUpAttempt structure.
packages/backend/src/api/resources/Enums.ts Removed SignUpStatus and added SignUpVerificationNextAction type.
packages/backend/src/api/resources/Deserializer.ts Integrated SignUpAttempt deserialization into the API client.
packages/backend/src/api/factory.ts Added instantiation of SignUpAPI in the backend API client factory.
packages/backend/src/api/endpoints/index.ts Exported the new SignUpApi endpoint.
packages/backend/src/api/endpoints/SignUpApi.ts Implemented GET and PATCH endpoints for sign up attempts.
.changeset/smooth-ways-arrive.md Added a changeset documenting the new sign up attempts feature.

} from './Enums';

export type { SignUpStatus } from '@clerk/types';
Copy link
Member

Choose a reason for hiding this comment

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

Is this re-export needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

@jacekradko In theory, no, but I added it to keep consistency with the code above:

  SignInStatus,
} from './Enums';

@tmilewski tmilewski merged commit aa93f7f into main Apr 16, 2025
30 checks passed
@tmilewski tmilewski deleted the tm/eco-590-sign-ups branch April 16, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants