Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add option to pass client url when initializing relayer channel #181

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ahollenbach
Copy link

@ahollenbach ahollenbach commented Jul 18, 2024

[draft to explain the concept, not a fully baked PR]

Motivation

As it currently exists, the only client supported by the Warpcast relay servers is the Warpcast app, redirecting all auth requests to https://warpcast.com/~/sign-in-with-farcaster. Apps like Supercast currently have no way to have other apps SIWF unless they export a seed phrase and import that into the Warpcast app.

This PR adds some light flexibility to this by allowing the implementing page to specify the target client URL

This PR does not address any larger issues around assembling a registry or require handling. It currently does not recommend any changes to AuthKit itself - implementation of passing in the client URL is up to individual implementers to start.

Change Summary

Instead of pulling from env, channel creation is updated to support passing in a client URL when initializing the channel. An example of how this could be used:

function initSignInWithFarcaster(clientUrl?: string) {
  const res = await axios.post('https://relay.farcaster.xyz/v1/channel', {
      ...,
      clientUrl
  });
  // 
  console.log(res.data.connectUri)
  // => https://api.supercast.xyz/siwf?channelToken=...
}

...

<button onClick={() => initSignInWithFarcaster()}>Sign in with Warpcast</button>
<button onClick={() => initSignInWithFarcaster("https://api.supercast.xyz/siwf"}>Sign in with Supercast</button>

Merge Checklist

Choose all relevant options below by adding an x now or at any time before submitting for review

  • PR title adheres to the conventional commits standard
  • PR has a changeset
  • PR has been tagged with a change label(s) (i.e. documentation, feature, bugfix, or chore)
  • PR includes documentation if necessary
  • All commits have been signed

Additional Context

If this is a relatively large or complex change, provide more details here that will help reviewers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant