# How to call operations with FT4 authentication · Chromia Docs (concept)

> This recipe demonstrates how to call dapp operations that require FT4 authentication using a Web3 provider (e.g., MetaMask).

Source: https://docs.chromia.com/build/cookbook/transaction-creation/call-operation-with-ft4-auth/

# How to call operations with FT4 authentication

On this page

* [Prerequisites](#prerequisites)
* [Demo script](#demo-script)
* [Key Features](#key-features)
* [Authentication Flow](#authentication-flow)
* [Learn more](#learn-more)

This recipe demonstrates how to call dapp operations that require FT4 authentication using a Web3 provider (e.g.,
MetaMask). This is essential for interacting with custom dapp operations that need authenticated user accounts.

JS/TS client

## Prerequisites

* **Node.js**
* **Web3 provider** (e.g., MetaMask browser extension)
* **FT4 client:** `npm install @chromia/ft4`
* **Postchain client:** `npm install postchain-client`

## Demo script

* [Call operation with FT4 auth demo](https://bitbucket.org/chromawallet/recipes/src/main/call_operation_with_ft4_auth/)

## Key Features

This recipe includes examples for:

* **Web3 integration** - Using injected Web3 providers like MetaMask for key management
* **FT4 authentication** - Creating authenticated sessions for operation calls
* **Custom operations** - Calling arbitrary dapp operations that require user authentication
* **Session management** - Handling FT4 session creation and operation execution

## Authentication Flow

The recipe demonstrates this flow:

1. **Connect to Web3 provider** - Uses [`createWeb3ProviderEvmKeyStore`](https://docs.chromia.com/pages/ft4-ts-client/functions/authentication.createWeb3ProviderEvmKeyStore/) to integrate with MetaMask
2. **Get FT4 accounts** - Retrieves accounts associated with the Web3 provider
3. **Create session** - Establishes an authenticated FT4 session
4. **Call operations** - Executes custom dapp operations with proper authentication

## Learn more

* [FT4 client documentation](https://docs.chromia.com/build/clients/ft4-client/) — covers account management and FT4 operations.
* [Account management](https://docs.chromia.com/build/ft4/account-management/) — understanding FT4 accounts and authentication.
* [JavaScript/TypeScript client](https://docs.chromia.com/build/clients/postchain-clients/javascript-typescript/reference/) — covers setup, connection,
  and usage patterns.

[View this page on docs.chromia.com](https://docs.chromia.com/build/cookbook/transaction-creation/call-operation-with-ft4-auth/)Content mirrored from the live docs
