The Airstack Frames SDK empowers developers to seamlessly integrate Farcaster data, including Farcaster user details, Farcaster followers and followings, Farcaster casts, Farcaster channels and more, into their Frames using just a few lines of code.
Additionally, developers can leverage the SDK to create an allow list feature, enabling checks for channel followings, user following status, and more.
Designed with TypeScript, the SDK offers full type support for those building Frames with TypeScript.
Fetch Farcaster user details, including profile name, fnames, profile images (resized), user-associated addresses (connected addresses), follower count and following count.
[{"castHash":"0xcee805b0b5a762892512d38d30b72dd692772480","castedAtTimestamp":"2024-04-06T06:24:32Z","castUrl":"https://warpcast.com/betashop.eth/0xcee805b0","embeds":[{"url":"https://share.airstack.xyz/s/gf"}],"text":"hihi follow my trade on @base! cc @betashop.eth @airstack","numberOfRecasts":17,"numberOfLikes":92,"numberOfReplies":14,"channel":"airstaack","mentions":[{"fid":"12142","position":24},{"fid":"602","position":29},{"fid":"20909","position":30}],"frame":{"frameHash":"0xbbd09a3a2c6b96eff53d9ad622b5637374bd2ec7b9c706fd8c908a6bc1a6bdc0","frameUrl":"https://share.airstack.xyz/s/gf"}}]
getFarcasterUserReplies
Fetch all replies of a Farcaster user in descending timestamp order.
Input
Field
Type
Required
Description
fid
number
true
FID of a Farcaster user
limit
number
false
Number of results per pages. Maximum value is 200. For more results, use paginations.
[{"castHash":"0x5b08dd51fe7ba6c5645dfda9e1c2dffb99ae38fd","castedAtTimestamp":"2024-05-08T15:37:20Z","castUrl":"https://warpcast.com/betashop.eth/0x5b08dd51","embeds":[],"text":"build great frames = get free analytics and rewards from Airstack","numberOfRecasts":6,"numberOfLikes":39,"numberOfReplies":3,"channel":"airstack","mentions":[],"frame":null}]
getFarcasterUserLikes
Fetch all casts liked by a Farcaster user in descending timestamp order.
Input
Field
Type
Required
Description
fid
number
true
FID of a Farcaster user
limit
number
false
Number of results per pages. Maximum value is 200. For more results, use paginations.
[{"castHash":"0xf94e79d8b812a3a9a127444515b17d83ee31d09a","castedAtTimestamp":"2024-05-07T20:52:29Z","castUrl":"https://warpcast.com/0xhuangkuan/0xf94e79d8","embeds":[],"text":"I like the strategy","numberOfRecasts":0,"numberOfLikes":1,"numberOfReplies":0,"channel":"fc-devs","mentions":[],"frame":null}]
getFarcasterChannelDetails
Fetch all details of a given Farcaster channel, including name, description, warpcast URL, image URL, creation time, hosts, etc.
Input
Field
Type
Required
Description
channel
string
true
Farcaster channel ID, e.g. /airstack channel ID is "airstack"
{"name":"Farcaster","description":"Discussions about Farcaster on Farcaster (meta!)","imageUrl":"https://ipfs.decentralized-content.com/ipfs/bafkreialf5usxssf2eu3e5ct37zzdd553d7lg7oywvdszmrg5p2zpkta7u","createdAtTimestamp":"2023-08-02T22:33:26Z","hosts":[{"profileName":"v","fnames":["v","varunsrin.eth"],"fid":"2","profileImage":{"extraSmall":"https://assets.airstack.xyz/image/social/XCPJH5EP49qftYc7+wAFfv5jzo3ddBWc9FMEERWezG8=/extra_small.png","small":"https://assets.airstack.xyz/image/social/XCPJH5EP49qftYc7+wAFfv5jzo3ddBWc9FMEERWezG8=/small.png","medium":"https://assets.airstack.xyz/image/social/XCPJH5EP49qftYc7+wAFfv5jzo3ddBWc9FMEERWezG8=/medium.png","large":"https://assets.airstack.xyz/image/social/XCPJH5EP49qftYc7+wAFfv5jzo3ddBWc9FMEERWezG8=/large.png","original":"https://assets.airstack.xyz/image/social/XCPJH5EP49qftYc7+wAFfv5jzo3ddBWc9FMEERWezG8=/original_image.png"},"userAssociatedAddresses":["0x4114e33eb831858649ea3702e1c9a2db3f626446","0x91031dcfdea024b4d51e775486111d2b2a715871","0x182327170fc284caaa5b1bc3e3878233f529d741","0xf86a7a5b7c703b1fd8d93c500ac4cc75b67477f0"],"followerCount":142424,"followingCount":1127}],"warpcastUrl":"https://warpcast.com/~/channel/farcaster"}
getFarcasterChannelParticipants
Fetch the list of all participants of a Farcaster channel that has either casted or replied to a cast in the specified channel. You can also use the lastActionTimestamp to only fetch users that have last participated during the specified time range.
Input
Field
Type
Required
Description
channel
string
true
Farcaster channel ID, e.g. /airstack channel ID is "airstack"
actionType
FarcasterChannelActionType
false
Farcaster channel action type, either cast or reply. Defaults to include both type.
lastActionTimestamp.before
string
false
get participants that participate before the specified input. ISO 8601 date string, e.g. "2024-02-28T00:00:00Z".
lastActionTimestamp.after
string
false
get participants that participate after the specified input. ISO 8601 date string, e.g. "2024-02-28T00:00:00Z".
limit
number
false
Number of results per pages. Defaults to 200. Maximum value is 200. For more results, use paginations.
Fetch all the channels where a Farcaster user has participated in, either by casting or replying to a cast. You can also use the lastActionTimestamp to only fetch channels where users have last participated during the specified time range.
Input
Field
Type
Required
Description
fid
number
true
Farcaster channel participant's FID
actionType
FarcasterChannelActionType
false
Farcaster channel action type, either cast or reply. Defaults to include both type.
lastActionTimestamp.before
string
false
get participants that participate before the specified input. ISO 8601 date string, e.g. "2024-02-28T00:00:00Z".
lastActionTimestamp.after
string
false
get participants that participate after the specified input. ISO 8601 date string, e.g. "2024-02-28T00:00:00Z".
limit
number
false
Number of results per pages. Defaults to 200. Maximum value is 200. For more results, use paginations.
Fetch all the channels where a Farcaster user is the host. You can also use the createdAtTimestamp to only fetch channels that are created in the specified timestamp.
Input
Field
Type
Required
Description
fid
number
true
Farcaster channel host's FID
createdAtTimestamp.before
string
false
get participants that participate before the specified input. ISO 8601 date string, e.g. "2024-02-28T00:00:00Z".
createdAtTimestamp.after
string
false
get participants that participate after the specified input. ISO 8601 date string, e.g. "2024-02-28T00:00:00Z".
limit
number
false
Number of results per pages. Defaults to 200. Maximum value is 200. For more results, use paginations.
[{"name":"airstack","description":"a place for updates about new airstack functionality, user requests, questions, and more!","imageUrl":"https://i.imgur.com/13jY9D4.png","createdAtTimestamp":"2023-12-21T17:30:38Z","warpcastUrl":"https://warpcast.com/~/channel/airstack"}]
searchFarcasterChannels
Fetch all the Farcaster channels that contain the specified input words in their names. You can also use the createdAtTimestamp to only fetch channels that are created in the specified timestamp.
Input
Field
Type
Required
Description
channel
string
true
Farcaster channel's name
createdAtTimestamp.before
string
false
get participants that participate before the specified input. ISO 8601 date string, e.g. "2024-02-28T00:00:00Z".
createdAtTimestamp.after
string
false
get participants that participate after the specified input. ISO 8601 date string, e.g. "2024-02-28T00:00:00Z".
limit
number
false
Number of results per pages. Defaults to 200. Maximum value is 200. For more results, use paginations.
[{"name":"airstack","description":"a place for updates about new airstack functionality, user requests, questions, and more!","imageUrl":"https://i.imgur.com/13jY9D4.png","createdAtTimestamp":"2023-12-21T17:30:38Z","hosts":[{"profileName":"betashop.eth","fnames":["betashop","betashop.eth","jasongoldberg.eth"],"fid":"602","profileImage":{"extraSmall":"https://assets.airstack.xyz/image/social/TQjjhuaajVkwqgzZVvgFQYU1qxNfVHQgSmZjTcXRrzQ=/extra_small.png","small":"https://assets.airstack.xyz/image/social/TQjjhuaajVkwqgzZVvgFQYU1qxNfVHQgSmZjTcXRrzQ=/small.png","medium":"https://assets.airstack.xyz/image/social/TQjjhuaajVkwqgzZVvgFQYU1qxNfVHQgSmZjTcXRrzQ=/medium.png","large":"https://assets.airstack.xyz/image/social/TQjjhuaajVkwqgzZVvgFQYU1qxNfVHQgSmZjTcXRrzQ=/large.png","original":"https://assets.airstack.xyz/image/social/TQjjhuaajVkwqgzZVvgFQYU1qxNfVHQgSmZjTcXRrzQ=/original_image.png"},"custodyAddress":"0x66bd69c7064d35d146ca78e6b186e57679fba249","connectedAddresses":[{"address":"0xeaf55242a90bb3289db8184772b0b98562053559","blockchain":"ethereum","chainId":"1","timestamp":"2023-05-31T13:58:49Z"}],"userAssociatedAddresses":["0x66bd69c7064d35d146ca78e6b186e57679fba249","0xeaf55242a90bb3289db8184772b0b98562053559"],"followerCount":59421,"followingCount":2290}],"warpcastUrl":"https://warpcast.com/~/channel/airstack"}]
searchFarcasterUsers
Search Farcaster users that contain a given string input, e.g. all Farcaster users that contain "a" in their profile name.
Input
Field
Type
Required
Description
profileName
string
true
string to match with the profile name. Only profile name that contains this inputted string will be returned in the response.
limit
number
false
Number of results per pages. Defaults to 200. Maximum value is 200. For more results, use paginations.
The Farcaster Data middleware injects Farcaster data of the user that interacted with the Frames, including Farcaster user details, followers, followings, casts.
For more details, check out the tutorial on Onchain Data Frog middleware here.
Input
Parameters
Type
Required
Description
apiKey
string
false
Configure API key, if no API key has been provided with init function.
features
Object
true
An object that contains variables used for fetching Farcaster data of the user.
env
prod | dev
false
Configure whether the environment is dev (using untrustedData) or prod (validate trustedData with validateFramesMessage API). By default, it is prod.
The Allow List middleware injects allow list logic to check if a user is allowed to access a frame or not, based on various criterias, such as Farcaster follower counts and following certain Farcaster users.
For more details, check out the tutorial on Allow List Frog middleware here.
Input
Parameters
Type
Required
Description
apiKey
string
false
Configure API key, if no API key has been provided with init function.
allowListCriteria
object
true
Criteria to check if the user is allowed
isAllowedFunction
function
false
Custom function to determine if the user is allowed. It will use AND logic by default.
env
prod | dev
false
Configure whether the environment is dev (using untrustedData) or prod (validate trustedData with validateFramesMessage API). By default, it is prod.
The Farcaster Data middleware injects onchain data of the user that interacts with the Frame, including Farcaster user details, followings, followers, Farcaster channels, etc.
For more details, check out the tutorial on Farcaster Data Frames.js middleware here.
Input
Parameters
Type
Required
Description
apiKey
string
false
Configure API key, if no API key has been provided with init function.
The Allow List middleware injects allow list logic to check if a user is allowed to access a frame or not, based on various criterias, such as Farcaster follower counts and following certain Farcaster users.
For more details, check out the tutorial on Allow List Frames.js middleware here.
Input
Parameters
Type
Required
Description
apiKey
string
false
Configure API key, if no API key has been provided with init function.
exportenumFrameRatio {
/**
* Set Frame Ratio to 1:1
*/
_1__1 = "1:1",
/**
* Set Frame Ratio to 1.91:1
*/
_1_91__1 = "1.91:1",
}
Features
exportenumFeatures {
/**
* Fetches Farcaster user details, e.g. profile name, fid, number of followers/followings, etc.
*/USER_DETAILS = "user_details",
/**
* Fetches Farcaster followings of a Farcaster user.
*/FARCASTER_FOLLOWINGS = "farcaster_followings",
/**
* Fetches Farcaster followers of a Farcaster user.
*/FARCASTER_FOLLOWERS = "farcaster_followers",
/**
* Fetches Farcaster channels of a Farcaster user.
*/FARCASTER_CHANNELS = "farcaster_channels",
/**
* Fetches Farcaster casts of a Farcaster user.
*/FARCASTER_CASTS = "farcaster_casts",
}
AllowListCriteriaEnum
exportenumAllowListCriteriaEnum {
/**
* Check if the user has certain number of farcaster followers
*/NUMBER_OF_FARCASTER_FOLLOWERS = "number_of_farcaster_followers",
/**
* Check if the user is followed by certain users on farcaster
*/FARCASTER_FOLLOWED_BY = "farcaster_followed_by",
/**
* Check if the user is following certain users on farcaster
*/FARCASTER_FOLLOWING = "farcaster_following",
/**
* Check if the user is following the caster
*/FARCASTER_FOLLOWING_CASTER = "farcaster_following_caster",
}
Paginations
Some functions provide pagination fields that you can use to paginate through the results.
The npm package @airstack/frames receives a total of 946 weekly downloads. As such, @airstack/frames popularity was classified as not popular.
We found that @airstack/frames demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 0 open source maintainers collaborating on the project.
Package last updated on 22 Aug 2024
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.