npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@amerej/connect2ic

v1.0.0

Published

<img height="100" src="https://connect2ic.github.io/docs/img/connect2ic_logo_light.png" />

Downloads

6

Readme

Connect2IC

A toolkit which makes it trivial to support any wallet or identity provider, and make authenticated calls to canisters.

Introduction

There are many new wallets coming out and adding support for these isn't always easy. Connect2ic allows you to get fully working auth for the most popular providers with only a few lines of code. Use the already styled <ConnectDialog /> component or feel free to create your own. Connect2ic gives you full control and additionally provides you with convenient helper utilities such as useCanister() and useTransfer().

Full documentation

Visit https://connect2ic.github.io/docs/

See https://github.com/MioQuispe/create-ic-app/ for examples

Community

You can ask us questions directly :) https://discord.com/invite/4kqMVknpgZ

Supported providers

Packages

| package | description | | ----------- | ----------- | | @connect2ic/core | Client, connectors, assets and utilities | | @connect2ic/react | React components & hooks | | @connect2ic/vue | Vue components & composables | | @connect2ic/svelte | Svelte components & stores |

React

Following these steps will give you fully working auth with a <ConnectButton /> and <ConnectDialog /> as shown in the top image.

1. Install the necessary packages

npm i -S @connect2ic/core @connect2ic/react

2. Wrap your app with the Provider and optionally pass in canister definitions (as generated by dfx)

import { defaultProviders } from "@connect2ic/core/providers"
import { createClient } from "@connect2ic/core"
import { Connect2ICProvider } from "@connect2ic/react"
import "@connect2ic/core/style.css"
import * as counter from "canisters/counter"

const client = createClient({
  canisters: {
    counter,
  },
  providers: defaultProviders,
})

const AppRoot = () => (
  <Connect2ICProvider client={client}>
    <App />
  </Connect2ICProvider>
)

3. Place the components

import { ConnectButton, ConnectDialog, Connect2ICProvider, useConnect } from "@connect2ic/react"

function App() {
  
  const { isConnected, principal, activeProvider } = useConnect({
    onConnect: () => {
      // Signed in
    },
    onDisconnect: () => {
      // Signed out
    }
  })

  return (
    <>
      <ConnectButton />
      <ConnectDialog dark={false} />
    </>
  )
}

4. Done

Vue

Following these steps will give you fully working auth with a <ConnectButton /> and <ConnectDialog /> as shown in the top image.

1. Install the necessary packages

npm i -S @connect2ic/core @connect2ic/vue

2. Wrap your app with the Provider and optionally pass in canister definitions (as generated by dfx)


<script setup>
  import { createClient } from "@connect2ic/core"
  import { defaultProviders } from "@connect2ic/core/providers"
  import { Connect2ICProvider } from "@connect2ic/vue"
  import "@connect2ic/core/style.css"
  import * as counter from "canisters/counter"
  
  const client = createClient({
    canisters: {
      counter,
    },
    providers: defaultProviders,
  })
</script>

<template>
  <Connect2ICProvider :client="client">
    <App />
  </Connect2ICProvider>
</template>

3. Place the components


<script setup>
  import { ConnectButton, ConnectDialog, useConnect } from "@connect2ic/vue"

  const { isConnected, principal, activeProvider } = useConnect({
    onConnect: () => {
      // Signed in
    },
    onDisconnect: () => {
      // Signed out
    }
  })
</script>

<template>
  <div class="my-app">
    <ConnectButton />
    <ConnectDialog />
  </div>
</template>

4. Done

Svelte

Following these steps will give you fully working auth with a <ConnectButton /> and <ConnectDialog /> as shown in the top image.

1. Install the necessary packages

npm i -S @connect2ic/core @connect2ic/svelte

2. Wrap your app with the Provider and optionally pass in canister definitions (as generated by dfx)

<script>
  import { createClient } from "@connect2ic/core"
  import { defaultProviders } from "@connect2ic/core/providers"
  import { Connect2ICProvider } from "@connect2ic/svelte"
  import "@connect2ic/core/style.css"
  import * as counter from "canisters/counter"

  const client = createClient({
    canisters: {
      counter,
    },
    providers: defaultProviders,
  })
</script>

<Connect2ICProvider client={client}>
  <App />
</Connect2ICProvider>

3. Place the components

<script>
  import { ConnectButton, ConnectDialog, useConnect } from "@connect2ic/svelte"
  
  const { isConnected, principal, activeProvider } = useConnect({
    onConnect: () => {
      // Signed in
    },
    onDisconnect: () => {
      // Signed out
    }
  })
</script>

<div class="my-app">
  <ConnectButton />
  <ConnectDialog />
</div>

4. Done