> ## Documentation Index
> Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Enable Write Access to Farcaster

## Introduction

This tutorial will help you enable Sign in with Farcaster in your application, as well as enabling write access to Farcaster on behalf of that user.

We've partnered with the wonderful team at Neynar on this use case who have implemented Dynamic as part of Sign in with Neynar. This means three things for you:

* it's completely plug and play, drop in the code snippet and ship
* warps are already sponsored by Neynar
* you get the best of Dynamic and Neynar in one go

## Video walkthrough

<Frame>
  <iframe src="https://www.loom.com/embed/72ad193653374ec5a52e0e29fcefb721?sid=a24d135e-946a-4593-af8a-12a7be81ac75" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen width="100%" height="640" />
</Frame>

## Live demo

You can see this flow in action on the Neynar demo: [https://demo.neynar.com/](https://demo.neynar.com/). You can find the code for this demo [here](https://github.com/neynarxyz/farcaster-examples/tree/main/wownar).

## Step By Step Walkthrough

<Tip>
  We recommend referring to [the Neynar guide](https://docs.neynar.com/docs/how-to-let-users-connect-farcaster-accounts-with-write-access-for-free-using-sign-in-with-neynar-siwn) for the most up-to-date information.
</Tip>

### Configure Neynar

Go to [the Neynar Developer Portal settings tab](https://dev.neynar.com/app) and update the following:

Name - Displayed to the user in Step 3.
Logo URL - Displayed to the user in Step 3. Use a PNG or SVG format.
Authorized origins - Authorized origins are the HTTP origins that host your web application. e.g. [https://demo.neynar.com](https://demo.neynar.com) This is required to pass user credentials back to your application securely. This cannot contain wildcards or IP addresses.

### Drop in the code snippet

Add the following code snippet to your html, replacing `YOUR_NEYNAR_CLIENT_ID` with your Neynar client ID. You can find this in [the Neynar Developer Portal App tab](https://dev.neynar.com/app):

```html theme={"system"}
<html>
  <body>
    <div
      class="neynar_signin"
      data-client_id="YOUR_NEYNAR_CLIENT_ID"
      data-success-callback="onSignInSuccess"
      data-theme="dark"> <!-- defaults to light, unless specified -->
    </div>
		<script src="https://neynarxyz.github.io/siwn/raw/1.2.0/index.js" async></script>
		<script>
      // Define the onSignInSuccess callback function
      function onSignInSuccess(data) {
        console.log("Sign-in success with data:", data);
        // Your code to handle the sign-in data
      }
	   </script>
  </body>
</html>
```

### Handle callback

Once the user is authenticated and a signer has been authorized by the user, the signer\_uuid and fid will be passed in via the data object in the callback function.

signer\_uuid is unique to your app and is used to write to Farcaster on behalf of the user (same uuid format)
fid: This is the unique Farcaster identifier for the user e.g. 6131
Store the signer\_uuid securely on your backend or the browser’s local storage, it's not meant to be exposed to the user or anyone other than you. Switch the app to the logged-in state for that Farcaster user.

### Ship it!

You’re all set! The user is now logged in and you should use the fid for any [read APIs](https://docs.neynar.com/docs/what-does-vitalikeths-farcaster-feed-look-like) and the signer\_uuid to do any [write actions](https://docs.neynar.com/docs/liking-and-recasting-with-neynar-sdk) on behalf of the user in your App.
