Skip to content

API v2 #21

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

API v2 #21

wants to merge 6 commits into from

Conversation

stigi
Copy link
Contributor

@stigi stigi commented Feb 13, 2025

Change description

This updates the app to follow the v2 API:

  • Using User JWT token to authenticate
  • Using the v2 API via @magicbell/user-client instead of magicbell/user-client

Test Plan

Signed in with a JWT token and saw the device token registered in the dashboard.

CleanShot.2025-02-13.at.18.02.48.mp4

Type of Change

  • Bug fix
  • Feature
  • Enhancement

stigi added a commit to magicbell/magicbell-js that referenced this pull request Feb 14, 2025
The v1 user client supports token auth
([code](https://github.com/magicbell/magicbell-js/blob/794f5220f485415863e414bf500d8d982ff66663/packages/magicbell/src/user-client.ts/#L14)),
but that was not available in react-headless
([code](https://github.com/magicbell/magicbell-js/blob/794f5220f485415863e414bf500d8d982ff66663/packages/react-headless/src/stores/clientSettings.ts/#L6-L15)).

This PR allows to pass the `token` through the `MagicBellProvide` to the
`UserClient` where it was already accepted.

I've tested this in magicbell/mobile-inbox#21
where I used the preview package and can confirm that notifications load
successfully when using a v2 JWT token.
@stigi stigi marked this pull request as ready for review February 14, 2025 14:18
@stigi stigi requested review from smeijer and unamashana February 14, 2025 14:19
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant