Giter VIP home page Giter VIP logo

particle-web-auth-core's Introduction

Particle Auth Core

Quick start

You can scaffold a new Particle Auth Core app with one of the following commands, using your package manager of choice:

npm init @particle-network/auth-core-modal@latest
# or
pnpm create @particle-network/auth-core-modal@latest
# or
yarn create @particle-network/auth-core-modal

Examples

Create a .env file like .env.sample in ./packages/auth-core-demo/ and replace xxx with your own Particle project configuration registered on the Dashboard.

To run an example locally, install dependencies.

yarn install

yarn dev:demo

Learn More

particle-web-auth-core's People

Contributors

chaichuanfa avatar wlasd4622 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

particle-web-auth-core's Issues

@particle-network/auth-core-modal does not work with Vite-TS

Hello everyone, if you know this issue, please help me fix it. I follow the tutorial, but this error:

 [ERROR] Failed to resolve entry for package "https". The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-pre-bundle]

    node_modules/micro-ftch/index.js:55:26:
      55 │     const https = require('https');
     ╵                           ~~~~~~~

File main.tsx

import { AuthCoreContextProvider } from '@particle-network/auth-core-modal';
import { Buffer } from 'buffer';
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App.tsx';
import './index.css';

if (typeof window !== 'undefined') {
    window.Buffer = Buffer;
    window.__PARTICLE_ENVIRONMENT__ = import.meta.env.VITE_PARTICLE_ENV;
}

ReactDOM.createRoot(document.getElementById('root')!).render(
    <React.StrictMode>
        <AuthCoreContextProvider
            options={{
                projectId: import.meta.env.VITE_PROJECT_ID as string,
                clientKey: import.meta.env.VITE_CLIENT_KEY as string,
                appId: import.meta.env.VITE_APP_ID as string,
            }}
        >
            <App />
        </AuthCoreContextProvider>
    </React.StrictMode>
);

Dependency issue with typescript

Trying to install produces the following error:
code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/typescript npm ERR! dev typescript@"5.2.2" from the root project npm ERR! peerOptional typescript@">=3.3.1" from [email protected] npm ERR! node_modules/eslint-config-next npm ERR! dev eslint-config-next@"14.0.3" from the root project npm ERR! 1 more (tsutils) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peerOptional typescript@"^3.2.1 || ^4" from [email protected] npm ERR! node_modules/react-scripts npm ERR! react-scripts@"5.0.1" from the root project npm ERR! peer react-scripts@">=2.1.3" from [email protected] npm ERR! node_modules/react-app-rewired npm ERR! react-app-rewired@"^2.2.1" from the root project npm ERR! npm ERR! Conflicting peer dependency: [email protected] npm ERR! node_modules/typescript npm ERR! peerOptional typescript@"^3.2.1 || ^4" from [email protected] npm ERR! node_modules/react-scripts npm ERR! react-scripts@"5.0.1" from the root project npm ERR! peer react-scripts@">=2.1.3" from [email protected] npm ERR! node_modules/react-app-rewired npm ERR! react-app-rewired@"^2.2.1" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

provider.connection.url returns "eip-1193:"

`
const particleProvider = new ParticleProvider(particle.auth);
const web3Provider = new ethers.providers.Web3Provider(particleProvider,"any");

const particleSigner = web3Provider.getSigner();
console.log("Particle Signer", particleSigner);

const rpc = particleSigner.provider?.connection.url;
console.log("RPC", rpc);
`

Hi guys, I have a quick question, why does your provider.connection.url return "eip-1193:" ? It should return the actual rpc url.

How can I get the rpc url from the "particleSigner" in this case ?

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.