Skip to main content
Most of the migration can be done quickly with AI: Using github copilot

Installation

OR

Client Initialization

v1
v2

Removed Methods and Changes in Method Names

All Neynar API v1-related methods have been removed from SDK v2. This version of the SDK will only support Neynar API v2.

Removed Methods

The following methods have been removed entirely from SDK v2: Checkout Affected v1 API Methods on how to replace it.

Renamed Methods

Several methods in SDK v2 have been renamed for consistency and clarity:

Methods Updated to v2 API

These methods retain the original method names but now use the v2 version of the neynar API:

Enum Changes

Renamed enums

The following enums have been renamed in SDK v2 to align with the updated naming conventions:

Enum Key Changes

Certain enum keys have been modified in SDK v2. If you were using the following enums, be aware that their key formats may have changed:
  • NotificationType
  • ValidateFrameAggregateWindow
  • FetchTrendingChannelsTimeWindowEnum (formerly TimeWindow)
  • FetchTrendingFeedTimeWindowEnum (formerly TrendingFeedTimeWindow)
  • FetchBulkCastsSortTypeEnum (formerly BulkCastsSortType)
  • BulkUserAddressType (formerly BulkUserAddressTypes)

Import Path Changes

All the api-related enums and schemas are now centralized and exported from /build/api directory instead of /build/neynar-api/v2/*
Imports for following isApiErrorResponse utility function and Webhook interfaces remains the same

Affected v1 API Methods

The following methods have been completely removed in SDK v2 (Ref. Removed Methods). As a result, the response structure will be different in the new methods that replace the deprecated v1 methods.

fetchAllCastsLikedByUser (Use fetchUserReactions)

fetchAllCastsLikedByUser
fetchUserReactions

lookupUserByFid (Use fetchBulkUsers)

lookupUserByFid
fetchBulkUsers

lookupCustodyAddressForUser (Use fetchBulkUsers)

lookupCustodyAddressForUser
fetchBulkUsers

lookUpCastByHash (Use lookupCastByHashOrWarpcastUrl)

lookUpCastByHash
lookupCastByHashOrWarpcastUrl

fetchAllCastsInThread (Use lookupCastConversation)

fetchAllCastsInThread
lookupCastConversation

fetchAllCastsCreatedByUser (Use fetchCastsForUser)

fetchAllCastsCreatedByUser
fetchCastsForUser

fetchUserVerifications (Use fetchBulkUsers)

fetchUserVerifications
fetchBulkUsers

lookupUserByVerification (Use fetchBulkUsersByEthOrSolAddress)

lookupUserByVerification
fetchBulkUsersByEthOrSolAddress

fetchMentionAndReplyNotifications (Use fetchAllNotifications)

fetchMentionAndReplyNotifications
fetchAllNotifications

fetchUserLikesAndRecasts (Use fetchUserReactions)

fetchUserLikesAndRecasts
fetchUserReactions

Affected v2 API Methods

  1. Arguments Format: In SDK v2, all methods now accept arguments as key-value pairs (kvargs). In SDK v1, only optional parameters were passed as key-value pairs, while required arguments were simple parameters.

Users

searchUser

v1
v2

fetchBulkUsers

v1
v2

fetchBulkUsersByEthereumAddress

v1
v2
  1. fetchBulkUsersByEthereumAddress is renamed to fetchBulkUsersByEthOrSolAddress (Ref. Renamed Methods)
  2. BulkUserAddressTypes is renamed to BulkUserAddressType (Ref. Renamed enums)
  3. Import path for BulkUserAddressType is changed (Ref. Import path changes)
  4. Enum key changed from CUSTODY_ADDRESS to CustodyAddress (Ref. Enum Key Changes)

lookupUserByCustodyAddress

v1
v2

lookupUserByUsernameV2

This method is renamed to lookupUserByUsername. v1
v2
lookupUserByUsernameV2 is now renamed to lookupUserByUsername (Ref. Methods Updated to v2 API)

fetchUsersByLocation

v1
v2

fetchPopularCastsByUser

v1
v2

fetchRepliesAndRecastsForUser

v1
v2

fetchCastsForUser

v1
v2

followUser

v1
v2

unfollowUser

v1
v2

registerAccount

v1
v2

updateUser

v1
v2

publishVerification

v1
v2

deleteVerification

v1
v2

fetchAuthorizationUrl

v1
v2
The import path for AuthorizationUrlResponseType is changed. (Ref. Import path changes)

Signer

lookupSigner

v1
v2

registerSignedKey

v1
v2

lookupDeveloperManagedSigner

v1
v2

registerSignedKeyForDeveloperManagedSigner

v1
v2

publishMessageToFarcaster

v1
v2

Cast

lookUpCastByHashOrWarpcastUrl

v1
v2
  1. lookUpCastByHashOrWarpcastUrl is renamed to lookupCastByHashOrWarpcastUrl (Ref. Renamed Methods)
  2. The import path for CastParamType is changed. (Ref. Import path changes)

publishCast

v1
v2
  1. replyTo param is now renamed to parent
  2. parent_author_fid is now cam camelCase (parentAuthorFid)
  3. sdk v1 response object is sdk v2 response.cast object

deleteCast

v1
v2

fetchBulkCasts

v1
v2
  1. BulkCastsSortType is renamed to FetchBulkCastsSortTypeEnum (Ref. Renamed enums)
  2. Enum key is changed now LIKES is Likes (Ref. Enum Key Changes)

searchCasts

v1
v2

lookupCastConversation

v1
v2
The import path for CastParamType is changed. (Ref. Import path changes)

fetchComposerActions

v1
v2
The import path for CastComposerType is changed. (Ref. Import path changes)

Feed

fetchUserFollowingFeed

v1
v2

fetchFeedForYou

v1
v2
The import path for ForYouProvider is changed. (Ref. Import path changes)

fetchFeedByChannelIds

v1
v2

fetchFeedByParentUrls

v1
v2

fetchFeed

v1
v2
The import path for FeedType is changed. (Ref. Import path changes)

fetchFramesOnlyFeed

v1
v2

fetchTrendingFeed

v1
v2
  1. TrendingFeedTimeWindow is renamed to FetchTrendingFeedTimeWindowEnum (Ref. Renamed enums)
  2. The import path is for FetchTrendingFeedTimeWindowEnum changed. (Ref. Import path changes)
  3. Enum Keys have changed SIX_HOUR to _6h (Ref. Enum Key Changes)

Reaction

publishReactionToCast

v1
v2
  1. publishReactionToCast is renamed to publishReaction (Ref. Renamed Methods)
  2. The import path for ReactionType is changed. (Ref. Import path changes)

deleteReactionFromCast

v1
v2
  1. deleteReactionFromCast is renamed to deleteReaction (Ref. Renamed Methods)
  2. The import path for ReactionType is changed. (Ref. Import path changes)

fetchUserReactions

v1
v2
The import path for ReactionsType is changed. (Ref. Import path changes)

fetchReactionsForCast

v1
v2
  1. fetchReactionsForCast is now renamed to fetchCastReactions (Ref. Renamed Methods)
  2. The import path for ReactionsType is changed. (Ref. Import path changes)

Notifications

Notifications include likes, mentions, replies, and quotes of a user’s casts.

fetchAllNotifications

v1
v2
  1. isPriority is removed.
  2. The import path is for NotificationType changed. (Ref. Import path changes)
  3. Enum Keys have changed LIKES to Likes (Ref. Enum Key Changes)
  4. Supports notification types: Likes, Mentions, Replies, and Quotes

fetchChannelNotificationsForUser

v1
v2
isPriority is removed.

fetchNotificationsByParentUrlForUser

v1
v2
isPriority is removed.

markNotificationsAsSeen

v1
v2
  1. The import path for NotificationType is changed. (Ref. Import path changes)
  2. Enum Keys have changed FOLLOWS to Follows (Ref. Enum Key changes)
  3. Supported notification types include Follows, Likes, Mentions, Replies, and Quotes

Channel

searchChannels

v1
v2

fetchBulkChannels

v1
v2
The import path for ChannelType is changed. (Ref. Import path changes)

lookupChannel

v1
v2

removeChannelMember

v1
v2
The import path for ChannelMemberRole is changed. (Ref. Import path changes)

fetchChannelMembers

v1
v2

inviteChannelMember

v1
v2
The import path for ChannelMemberRole is changed. (Ref. Import path changes)

respondChannelInvite

v1
v2
The import path for ChannelMemberRole is changed. (Ref. Import path changes)

fetchFollowersForAChannel

v1
v2

fetchRelevantFollowersForAChannel

v1
v2

fetchUserChannels

v1
v2

fetchUserChannelMemberships

v1
v2

followChannel

v1
v2

unfollowChannel

v1
v2

fetchTrendingChannels

v1
v2
  1. TimeWindow is renamed to FetchTrendingChannelsTimeWindowEnum (Ref. Renamed enums)
  2. FetchTrendingChannelsTimeWindowEnum import is changed (Ref. Import Path Changes)
  3. Enums key is changed from SEVEN_DAYS to _7d (Ref. Enum Key Changes)

fetchUsersActiveChannels

v1
v2

Follows

fetchUserFollowersV2

v1
v2
  1. fetchUserFollowersV2 is now renamed to fetchUserFollowers (Ref. Methods Updated to v2 API)
  2. FollowSortType import is changed (Ref. Import Path Changes)

fetchRelevantFollowers

v1
v2

fetchUserFollowingV2

v1
v2
  1. fetchUserFollowingV2 is now renamed to fetchUserFollowing (Ref. Methods Updated to v2 API)
  2. FollowSortType import is changed (Ref. Import Path Changes)

fetchFollowSuggestions

v1
v2

Storage

lookupUserStorageAllocations

v1
v2

lookupUserStorageUsage

v1
v2

buyStorage

v1
v2

Frame

postFrameAction

v1
v2

validateFrameAction

v1
v2

fetchValidateFrameAnalytics

v1
v2
  1. Import for ValidateFrameAnalyticsType and ValidateFrameAggregateWindow is changed (Ref. Import Path Changes)
  2. Enums key is changed from TWELVE_HOURS to _12h (Ref. Enum Key Changes)

lookupNeynarFrame

v1
v2
Import for FrameType is changed (Ref. Import Path Changes)

deleteNeynarFrame

v1
v2

fetchFrameMetaTagsFromUrl

v1
v2

postFrameActionDeveloperManaged

v1
v2

fname

isFnameAvailable

v1
v2

Webhook

lookupWebhook

v1
v2

publishWebhook

v1
v2

updateWebhookActiveStatus

v1
v2

updateWebhook

v1
v2

deleteWebhook

v1
v2

Action

publishFarcasterAction

v1
v2

Mute

fetchMuteList

v1
v2

publishMute

v1
v2

deleteMute

v1
v2

Block

publishBlock

v1
v2

deleteBlock

v1
v2

Ban

publishBans

v1
v2

deleteBans

v1
v2

Onchain

fetchUserBalance

v1
v2

fetchSubscriptionsForFid

v1
v2
Import for SubscriptionProvider is changed (Ref. Import Path Changes)

fetchSubscribedToForFid

v1
v2
Import for SubscriptionProvider is changed (Ref. Import Path Changes)

fetchSubscribersForFid

v1
v2

fetchSubscriptionCheck

v1
v2
This guide should assist in updating your existing code to SDK v2. If you encounter any issues or have further questions, please reach out to us. Warpcast Slack