open-index/open-npm huggingface dataset:
npm package: @icp-sdk/auth
Description: Authentication library for Internet Computer web apps
Author: DFINITY Stiftung
Latest version: 5.0.0

# @icp-sdk/auth

[![NPM Version](https://img.shields.io/npm/v/%40icp-sdk%2Fauth)](https://www.npmjs.com/package/@icp-sdk/auth)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

Authentication library for Internet Computer web apps.

> Still using `@dfinity/auth-client`? Migrate to [`@icp-sdk/auth`](https://js.icp.build/auth/latest/upgrading/v4)!

---

## Installation

You can install the `@icp-sdk/auth` package with your package manager of choice:

### npm

```shell
npm install @icp-sdk/auth
```

### pnpm

```shell
pnpm add @icp-sdk/auth
```

### yarn

```shell
yarn add @icp-sdk/auth
```

> Note: this package is only meant to be used in **browser** environments.

## Usage Example

Here's a simple example of how to use the `@icp-sdk/auth` package to authenticate a user with Internet Identity on an Internet Computer web app:

```typescript
import { AuthClient } from '@icp-sdk/auth/client';

const identityProvider = 'https://id.ai/';

const authClient = await AuthClient.create();
const identity = authClient.getIdentity(); // At this point, you'll get a Principal.anonymous()

async function onSuccess() {
  console.log('Login successful');

  const identity = authClient.getIdentity(); // At this point, you'll get an authenticated identity
  console.log(authClient.isAuthenticated()); // true
}

await authClient.login({
  identityProvider,
  onSuccess,
});

// later in your app
await authClient.logout();
```

Additional documentation can be found [here](https://js.icp.build/auth/latest/).

## Contributing

Contributions are welcome! Please see the [contribution guide](./.github/CONTRIBUTING.md) for more information.

## License

This project is licensed under the [Apache-2.0](./LICENSE) license.
npm package: @icp-sdk/bindgen
Description: Generate TypeScript bindings for Candid
Author: DFINITY Stiftung
Latest version: 0.3.0

# ICP JS SDK Bindgen

Generate modern TypeScript bindings for Internet Computer (IC) canisters from [Candid](https://github.com/dfinity/candid) `.did` files.

The tool can be used in three ways:
- [CLI](https://js.icp.build/bindgen/latest/cli)
- [Vite plugin](https://js.icp.build/bindgen/latest/plugins/vite)
- [Library](https://js.icp.build/bindgen/latest/core)

> Note: Generated code references `@icp-sdk/core` (agents, candid, principals). Install it in your app if you plan to compile/run the generated code. See [js.icp.build/core](https://js.icp.build/core).

## Install

```bash
npm i -D @icp-sdk/bindgen
```

## Quick start (Vite)

Generate bindings from a `hello_world.did` file into `src/bindings`:

```ts
// vite.config.ts
import { defineConfig } from 'vite';
import { icpBindgen } from '@icp-sdk/bindgen/plugins/vite';

export default defineConfig({
  plugins: [
    icpBindgen({
      didFile: './hello_world.did',
      outDir: './src/bindings',
    }),
  ],
});
```

Use the generated client:

```ts
import { createActor } from './bindings/hello_world';

const actor = createActor('your-canister-id');
const greeting = await actor.greet('World');
```

For more info, see the [docs](https://js.icp.build/bindgen/).

## Contributing

Contributions are welcome! Please see the [contribution guide](./.github/CONTRIBUTING.md) for more information.

## License

This project is licensed under the [Apache-2.0](./LICENSE) license.
npm package: @icp-sdk/core
Description: JavaScript and TypeScript library to interact with the Internet Computer
Author: DFINITY Stiftung
Latest version: 5.2.1

# @icp-sdk/core

The `@icp-sdk/core` package is a JavaScript and TypeScript library designed to interact with the Internet Computer. It acts as a meta-package that re-exports functionality from several other `@dfinity` packages, providing a convenient way to access multiple tools and utilities in one place.

Do you want to know more about developing on the Internet Computer? Visit the [Developer Docs](https://internetcomputer.org/docs/home).

---

## Installation

You can install the `@icp-sdk/core` package using your preferred package manager:

### npm

```shell
npm install @icp-sdk/core
```

### yarn

```shell
yarn add @icp-sdk/core
```

### pnpm

```shell
pnpm add @icp-sdk/core
```

## Import Paths

The package provides the following import paths for accessing the re-exported modules:

- `@icp-sdk/core/agent`
- `@icp-sdk/core/candid`
- `@icp-sdk/core/identity`
  - `@icp-sdk/core/identity/secp256k1`
- `@icp-sdk/core/principal`

## Usage Example

Here is an example of how to use the `@icp-sdk/core` package:

```ts
// Importing the HttpAgent from the agent module
import { HttpAgent } from '@icp-sdk/core/agent';

// Importing the Identity utility
import { Ed25519KeyIdentity } from '@icp-sdk/core/identity';

// Importing the Candid utility
import { IDL } from '@icp-sdk/core/candid';

// Importing the Principal utility
import { Principal } from '@icp-sdk/core/principal';

// Create a new identity
const identity = Ed25519KeyIdentity.generate();

// Create a Principal from a string
const canisterId = Principal.fromText('uqqxf-5h777-77774-qaaaa-cai');

// Create an HttpAgent instance
const agent = await HttpAgent.create({
  host: 'https://icp-api.io',
  identity,
});

// Call a canister
const response = await agent.call(canisterId, {
  methodName: 'greet',
  arg: IDL.encode([IDL.Text], ['world']),
});

console.log(response);
```

**Note:** If you are using TypeScript, this package requires the `node16` (or later) [`moduleResolution`](https://www.typescriptlang.org/tsconfig#moduleResolution) strategy to function correctly.

Additional API Documentation can be found [here](https://js.icp.build/core/latest/).

## Contributing

Contributions are welcome! Please refer to the [repository](https://github.com/dfinity/icp-js-core) for guidelines on contributing to this project.

## License

This project is licensed under the Apache-2.0 License. See the [LICENSE](https://github.com/dfinity/icp-js-core/blob/main/LICENSE) file for details.
npm package: @icp-sdk/core-migrate
Description: CLI tool to migrate from agent-js to @icp-sdk/core
Author: DFINITY Stiftung
Latest version: 1.0.2

# @icp-sdk/core-migrate

CLI tool to automatically migrate your project from `agent-js` packages to `@icp-sdk/core`.

## What it does

This tool automatically performs the migration steps described in the [upgrading guide](https://js.icp.build/core/latest/upgrading/v4/):

1. **Removes old dependencies**: Automatically removes the following `agent-js` packages from your project:
   - `@dfinity/agent`
   - `@dfinity/candid`
   - `@dfinity/identity`
   - `@dfinity/identity-secp256k1`
   - `@dfinity/principal`
2. **Adds new dependency**: Installs `@icp-sdk/core` package
3. **Updates imports**: Finds and replaces all import statements in your source code to use the new `@icp-sdk/core` package.
   > Note: this tool only replaces the `@dfinity/*` imports. If you are using `@dfinity/*` packages somewhere else in your code, e.g. in tests mocks, you will need to find and replace the occurrences manually.

### Supported package managers

- npm
- yarn
- pnpm

## Usage

Run the migration tool in your project directory.

With `npm`:

```shell
npx @icp-sdk/core-migrate@latest
```

With `pnpm`:

```shell
pnpm dlx @icp-sdk/core-migrate@latest
```

For more options, run `npx @icp-sdk/core-migrate@latest --help`.
npm package: @icp-sdk/ic-wasm
Description: npm wrapper for ic-wasm - WebAssembly optimization and instrumentation tool for Internet Computer canisters
Latest version: 0.9.10

# ic-wasm

npm package for [ic-wasm](https://github.com/dfinity/ic-wasm) with pre-compiled binaries.

## Installation

```bash
npm install -g ic-wasm
```

Or add to your project:

```bash
npm install --save-dev ic-wasm
```

## Usage

```bash
ic-wasm --help
ic-wasm --version
```

### Common Commands

```bash
# Optimize a Wasm file
ic-wasm input.wasm -o output.wasm shrink

# Metadata operations
ic-wasm input.wasm -o output.wasm metadata candid:service -d candid.did -v public
```

## How it Works

This package uses platform-specific optional dependencies to install the correct pre-compiled binary for your system. The binary is ready to use immediately after installation - no additional downloads required.

### Supported Platforms

- macOS ARM64 (Apple Silicon)
- macOS x64 (Intel)
- Linux ARM64
- Linux x64
- Windows x64

### Programmatic Usage

```javascript
const icWasm = require('ic-wasm');

console.log('ic-wasm binary location:', icWasm.binaryPath);
console.log('ic-wasm version:', icWasm.version);
```

## Links

- [ic-wasm GitHub Repository](https://github.com/dfinity/ic-wasm)
- [Internet Computer Documentation](https://internetcomputer.org/docs/current/developer-docs/)
- [ic-wasm Releases](https://github.com/dfinity/ic-wasm/releases)
npm package: @icp-sdk/icp-cli
Description: npm wrapper for icp-cli - Internet Computer Protocol command-line interface
Latest version: 0.2.3

# @icp-sdk/icp-cli

npm package for [icp-cli](https://github.com/dfinity/icp-cli) with pre-compiled binaries.

## Installation

```bash
npm install -g @icp-sdk/icp-cli
```

### Linux Users

On Linux, you may need to install system dependencies first:

```bash
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install -y libdbus-1-3 libssl3 ca-certificates

# Fedora/RHEL
sudo dnf install -y dbus-libs openssl ca-certificates
```

Then install icp-cli:

```bash
npm install -g @icp-sdk/icp-cli
```

## Usage

```bash
icp --help
icp --version
```

## How it Works

This package uses platform-specific optional dependencies to install the correct pre-compiled binary for your system. The binary is ready to use immediately after installation - no additional downloads required.

### Supported Platforms

- macOS ARM64 (Apple Silicon)
- macOS x64 (Intel)
- Linux ARM64
- Linux x64
- Windows x64

### Programmatic Usage

```javascript
const icp = require('@icp-sdk/icp-cli');

console.log('icp binary location:', icp.binaryPath);
console.log('icp version:', icp.version);
```