Coder Social home page Coder Social logo

Comments (11)

tfalencar avatar tfalencar commented on June 17, 2024 3

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.

hbriese avatar hbriese commented on June 17, 2024 2

@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.

niconiahi avatar niconiahi commented on June 17, 2024 2

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.

w4ll3 avatar w4ll3 commented on June 17, 2024 1

@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.

jwcheon avatar jwcheon commented on June 17, 2024 1

@dankcellar will you open source this in the future? would love to use it!

from siwe.

twtaylor avatar twtaylor commented on June 17, 2024

yeah this doesn't work in a FE for some functions

from siwe.

au2001 avatar au2001 commented on June 17, 2024

Any update on this?

from siwe.

bradwbradw avatar bradwbradw commented on June 17, 2024

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.

tfalencar avatar tfalencar commented on June 17, 2024

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.

bradwbradw avatar bradwbradw commented on June 17, 2024

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.

dankcellar avatar dankcellar commented on June 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.