Skip to content
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

Documentation : browser / React Native compatibility #50

Open
aymericbouzy opened this issue Feb 4, 2020 · 2 comments
Open

Documentation : browser / React Native compatibility #50

aymericbouzy opened this issue Feb 4, 2020 · 2 comments

Comments

@aymericbouzy
Copy link

I'm having a hard time figuring out in what JS environment will this package work. It makes a clear mention of Node.js but no mention of browser or React Native.

  1. will it work in browsers?
  2. will it work in React Native?
  3. would you be interested in me making a PR to add this to the documentation? Feel free to reject this suggestion if it's obvious to everyone that it will work everywhere 😅
@jhsmaciel
Copy link

jhsmaciel commented Jul 23, 2020

Tested on react-native, apparently does not work :(
I don't know if there are any workaround

@ahuggins-nhs
Copy link

ahuggins-nhs commented Aug 7, 2020

Tested on react-native, apparently does not work :(
I don't know if there are any workaround

https://github.com/ahuggins-nhs/base64url-xplatform
https://www.npmjs.com/package/base64url-xplatform

In browser:

import { Base64Url } from 'https://cdn.jsdelivr.net/npm/[email protected]/esm/index.js'

window.Base64Url = Base64Url

There is also a class called "BufferShim" which is exported and it can be used to work with string and ArrayBuffer to go to and from base64 and UTF8.

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

No branches or pull requests

3 participants