Most of the migration can be done quickly with AI: Using github copilot
Installation
Client Initialization
v1Removed 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:NotificationTypeValidateFrameAggregateWindowFetchTrendingChannelsTimeWindowEnum(formerlyTimeWindow)FetchTrendingFeedTimeWindowEnum(formerlyTrendingFeedTimeWindow)FetchBulkCastsSortTypeEnum(formerlyBulkCastsSortType)BulkUserAddressType(formerlyBulkUserAddressTypes)
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 sameAffected 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
- 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
fetchBulkUsers
v1
fetchBulkUsersByEthereumAddress
v1
fetchBulkUsersByEthereumAddressis renamed tofetchBulkUsersByEthOrSolAddress(Ref. Renamed Methods)BulkUserAddressTypesis renamed toBulkUserAddressType(Ref. Renamed enums)- Import path for
BulkUserAddressTypeis changed (Ref. Import path changes) - Enum key changed from
CUSTODY_ADDRESStoCustodyAddress(Ref. Enum Key Changes)
lookupUserByCustodyAddress
v1
lookupUserByUsernameV2
This method is renamed to lookupUserByUsername.
v1
lookupUserByUsernameV2 is now renamed to lookupUserByUsername (Ref. Methods Updated to v2 API)fetchUsersByLocation
v1
fetchPopularCastsByUser
v1
fetchRepliesAndRecastsForUser
v1
fetchCastsForUser
v1
followUser
v1
unfollowUser
v1
registerAccount
v1
updateUser
v1
publishVerification
v1
deleteVerification
v1
fetchAuthorizationUrl
v1
The import path for
AuthorizationUrlResponseType is changed. (Ref. Import path changes)Signer
lookupSigner
v1
registerSignedKey
v1
lookupDeveloperManagedSigner
v1
registerSignedKeyForDeveloperManagedSigner
v1
publishMessageToFarcaster
v1
Cast
lookUpCastByHashOrWarpcastUrl
v1
lookUpCastByHashOrWarpcastUrlis renamed tolookupCastByHashOrWarpcastUrl(Ref. Renamed Methods)- The import path for
CastParamTypeis changed. (Ref. Import path changes)
publishCast
v1
replyToparam is now renamed toparentparent_author_fidis now cam camelCase (parentAuthorFid)- sdk v1
responseobject is sdk v2response.castobject
deleteCast
v1
fetchBulkCasts
v1
BulkCastsSortTypeis renamed toFetchBulkCastsSortTypeEnum(Ref. Renamed enums)- Enum key is changed now
LIKESisLikes(Ref. Enum Key Changes)
searchCasts
v1
lookupCastConversation
v1
The import path for
CastParamType is changed. (Ref. Import path changes)fetchComposerActions
v1
The import path for
CastComposerType is changed. (Ref. Import path changes)Feed
fetchUserFollowingFeed
v1
fetchFeedForYou
v1
The import path for
ForYouProvider is changed. (Ref. Import path changes)fetchFeedByChannelIds
v1
fetchFeedByParentUrls
v1
fetchFeed
v1
The import path for
FeedType is changed. (Ref. Import path changes)fetchFramesOnlyFeed
v1
fetchTrendingFeed
v1
TrendingFeedTimeWindowis renamed toFetchTrendingFeedTimeWindowEnum(Ref. Renamed enums)- The import path is for
FetchTrendingFeedTimeWindowEnumchanged. (Ref. Import path changes) - Enum Keys have changed
SIX_HOURto_6h(Ref. Enum Key Changes)
Reaction
publishReactionToCast
v1
publishReactionToCastis renamed topublishReaction(Ref. Renamed Methods)- The import path for
ReactionTypeis changed. (Ref. Import path changes)
deleteReactionFromCast
v1
deleteReactionFromCastis renamed todeleteReaction(Ref. Renamed Methods)- The import path for
ReactionTypeis changed. (Ref. Import path changes)
fetchUserReactions
v1
The import path for
ReactionsType is changed. (Ref. Import path changes)fetchReactionsForCast
v1
fetchReactionsForCastis now renamed tofetchCastReactions(Ref. Renamed Methods)- The import path for
ReactionsTypeis changed. (Ref. Import path changes)
Notifications
Notifications include likes, mentions, replies, and quotes of a user’s casts.fetchAllNotifications
v1
isPriorityis removed.- The import path is for
NotificationTypechanged. (Ref. Import path changes) - Enum Keys have changed
LIKEStoLikes(Ref. Enum Key Changes) - Supports notification types: Likes, Mentions, Replies, and Quotes
fetchChannelNotificationsForUser
v1
isPriority is removed.fetchNotificationsByParentUrlForUser
v1
isPriority is removed.markNotificationsAsSeen
v1
- The import path for
NotificationTypeis changed. (Ref. Import path changes) - Enum Keys have changed
FOLLOWStoFollows(Ref. Enum Key changes) - Supported notification types include Follows, Likes, Mentions, Replies, and Quotes
Channel
searchChannels
v1
fetchBulkChannels
v1
The import path for
ChannelType is changed. (Ref. Import path changes)lookupChannel
v1
removeChannelMember
v1
The import path for
ChannelMemberRole is changed. (Ref. Import path changes)fetchChannelMembers
v1
inviteChannelMember
v1
The import path for
ChannelMemberRole is changed. (Ref. Import path changes)respondChannelInvite
v1
The import path for
ChannelMemberRole is changed. (Ref. Import path changes)fetchFollowersForAChannel
v1
fetchRelevantFollowersForAChannel
v1
fetchUserChannels
v1
fetchUserChannelMemberships
v1
followChannel
v1
unfollowChannel
v1
fetchTrendingChannels
v1
TimeWindowis renamed toFetchTrendingChannelsTimeWindowEnum(Ref. Renamed enums)FetchTrendingChannelsTimeWindowEnumimport is changed (Ref. Import Path Changes)- Enums key is changed from
SEVEN_DAYSto_7d(Ref. Enum Key Changes)
fetchUsersActiveChannels
v1
Follows
fetchUserFollowersV2
v1
fetchUserFollowersV2is now renamed tofetchUserFollowers(Ref. Methods Updated to v2 API)FollowSortTypeimport is changed (Ref. Import Path Changes)
fetchRelevantFollowers
v1
fetchUserFollowingV2
v1
fetchUserFollowingV2is now renamed tofetchUserFollowing(Ref. Methods Updated to v2 API)FollowSortTypeimport is changed (Ref. Import Path Changes)
fetchFollowSuggestions
v1
Storage
lookupUserStorageAllocations
v1
lookupUserStorageUsage
v1
buyStorage
v1
Frame
postFrameAction
v1
validateFrameAction
v1
fetchValidateFrameAnalytics
v1
- Import for
ValidateFrameAnalyticsTypeandValidateFrameAggregateWindowis changed (Ref. Import Path Changes) - Enums key is changed from
TWELVE_HOURSto_12h(Ref. Enum Key Changes)
lookupNeynarFrame
v1
Import for
FrameType is changed (Ref. Import Path Changes)deleteNeynarFrame
v1
fetchFrameMetaTagsFromUrl
v1
postFrameActionDeveloperManaged
v1
fname
isFnameAvailable
v1
Webhook
lookupWebhook
v1
publishWebhook
v1
updateWebhookActiveStatus
v1
updateWebhook
v1
deleteWebhook
v1
Action
publishFarcasterAction
v1
Mute
fetchMuteList
v1
publishMute
v1
deleteMute
v1
Block
publishBlock
v1
deleteBlock
v1
Ban
publishBans
v1
deleteBans
v1
Onchain
fetchUserBalance
v1
fetchSubscriptionsForFid
v1
Import for
SubscriptionProvider is changed (Ref. Import Path Changes)fetchSubscribedToForFid
v1
Import for
SubscriptionProvider is changed (Ref. Import Path Changes)