[on hold] Include Mini App state in the shared Mini App URL #227
gabrielayuso
announced in
Proposals
Replies: 2 comments 2 replies
-
I'm not 100% sure I understand the use case.
|
Beta Was this translation helpful? Give feedback.
2 replies
-
I like it. Maybe call it type ShareUrl = {
pathname?: string
searchParams?: URLSearchParams | ConstructorParameters<typeof URLSearchParams>[0]
}
type ShareUrlResolver = () => (ShareUrl | Promise<ShareUrl>)
type FrameSDK = {
// ...
setShareUrlResolver: (fn: ShareUrlResolver) => void
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goal
Let mini apps provide a path and query params to be included in the Mini App URL when the host shares a link to the mini app.
Background
Farcaster clients can generate Mini App URLs such as
https://warpcast.com/miniapps/VNo09-kNexFz/farcade
to link directly to a mini app. These URLs open thehomeURL
from the mini app's manifest by default.The Mini App URLs support passing query params down to the mini app and will soon also be able to pass the path as well.
Example:
However, currently mini apps don't have a way to let the host know that they want to add a path and query params to the Mini App URL when sharing.
Proposal
Let mini apps set a function that the host can call to obtain the share state when generating the Mini App URL.
This approach lets the host lazily obtain the share state only when necessary. It also gives mini apps the flexibility to build the path and query params however they like without the need to tie them with navigation state.
Type Definition
Example Usage
The path and params provided by the function given to
setShareStateProvider
will be added to the copied mini app URL which will be thehomeURL
when opened via thelauncher
and the embed URL when opened via acast_embed
(obtained fromsdk.context.location.type
).Beta Was this translation helpful? Give feedback.
All reactions