Comments (11)
I created a fork of apg-js, and added safer-buffer
to the project. Then I pushed it as a new packaged to npm: buffer-apg-js. I tested in my application and finally the application doesn't crash anymore and I'm able to use siwe in the browser with Vite / SvelteKit. If you'd like to test it as well you can replace the 'siwe' dependency with '@crowdtainer/siwe' (another package I pushed to npm which is a fork of siwe replacing apg-js with buffer-apg-js in the siwe-parser package). I'd like to eventually deprecate my custom fork though (@crowdtainer/siwe), so would be happy to see this solved in this repo (either by using the buffer-apg-js fork, or if spruce decides to create its own npm package with a fork.
I'm no longer using this approach - and not maintaining this package.
from siwe.
@tfalencar's issue has been closed as unfortunately apg-js is unwilling to find an alternative to Buffer.
Removing dependence on Buffer is incredibly important for portability
from siwe.
hey! I'm needing this as well. It's important to understand that many applications (everytime gets bigger) are running on the edge runtime, meaning that we don't have NodeAPIs. To me, it's a must for an application to remove all dependencies from Node and replace them with Web APIs
can at least the mantainer hint what changes would this include? I could take a look at it. The codebase seems small enough to work on
from siwe.
@tfalencar Thanks for your contribution, I'll bring up the discussion with the team today, we'll probably have our own fork as you mentioned but we'll make sure to credit your contribution. Will update the results soon.
from siwe.
@dankcellar will you open source this in the future? would love to use it!
from siwe.
yeah this doesn't work in a FE for some functions
from siwe.
Any update on this?
from siwe.
I created a fork of apg-js, and added
safer-buffer
to the project. Then I pushed it as a new packaged to npm: buffer-apg-js. I tested in my application and finally the application doesn't crash anymore and I'm able to use siwe in the browser with Vite / SvelteKit.If you'd like to test it as well you can replace the 'siwe' dependency with '@crowdtainer/siwe' (another package I pushed to npm which is a fork of siwe replacing apg-js with buffer-apg-js in the siwe-parser package).
I'd like to eventually deprecate my custom fork though (@crowdtainer/siwe), so would be happy to see this solved in this repo (either by using the buffer-apg-js fork, or if spruce decides to create its own npm package with a fork.
I tried importing your fork in vite using import { SiweMessage } from '@crowdtainer/siwe'
but i get "failed to resolve entry for package "@crowdtainer/siwe""
from siwe.
I tried importing your fork in vite using
import { SiweMessage } from '@crowdtainer/siwe'
but i get "failed to resolve entry for package "@crowdtainer/siwe""
Please check with the Spruce team, it seems they have another library now (SSX), maybe it doesn't have this issue. I don't know if this problem will be solved in spruce/siwe.
from siwe.
hey @tfalencar I would consider SSX but i'm doing a hackathon and I only have a couple days and I need siwe :) I'm not sure if your Buffer-friendly clone can be installed / imported using vite JS, but if you have any tips, I'd really appreciate it. I promise I won't leave it in a prod environment, it's just for a proof of concept
from siwe.
For anyone seeing this in 2024, I got it working: https://www.npmjs.com/package/cloudflare-siwe
import { SiweMessage, generateNonce } from 'cloudflare-siwe';
from siwe.
Related Issues (20)
- Using siwe message giving me error "Buffer is not defined" HOT 2
- ncaught Error: No QueryClient set, use QueryClientProvider to set one
- TypeError: (0 , siwe_parser_1.isEIP55Address) is not a function HOT 1
- Cannot read property 'SiweMessage' of undefined HOT 2
- Invalid signature recovery are logged via console.error, breaking applications with custom logging flow
- Viem support? HOT 13
- isEIP55Address cannot be called because @spruceid/siwe-parser might be below 2.0.0 version HOT 3
- Suggestion regarding siwe-parser usage of apg-js. HOT 9
- Please provide CDN HOT 1
- Change Provider configuration to allow plain RPC URL property
- Cannot sign in with Argent wallet HOT 1
- Custom logo when authenticating, possible? HOT 4
- Crash on iOS 14 When Initializing SiweMessage Instance HOT 5
- I'm not getting the right address when checking HOT 3
- '"ethers"' has no exported member named 'providers' HOT 1
- Why version "2.1.4", requires SiweMessage.version to be 1? HOT 1
- Module parse failed: 'import' and 'export' may appear only with 'sourceType: module' (2:0) HOT 1
- Cloudflare Workers compatibility HOT 3
- invalid opts check is looking at the wrong array HOT 1
- update quickstart example code to include provider for 1271 support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from siwe.