Skip to content

Conversation

@carsonfarmer
Copy link
Member

This is a pretty simple demo/example of taking advantage of our new ES modules supports in all @textile/* libs. Here, an app in dev mode is used to create a basic HTML app that imports and existing "user" identity, and then authenticates with this user on the hub. It does not create any new data or threads on the hub, and any folks playing with the demo should use their own hub credentials and identities. Copies concepts from the user mailbox demo app.

Signed-off-by: Carson Farmer <carson.farmer@gmail.com>
@carsonfarmer carsonfarmer added documentation Improvements or additions to documentation enhancement New feature or request labels Dec 21, 2020
@carsonfarmer carsonfarmer self-assigned this Dec 21, 2020
Signed-off-by: Carson Farmer <carson.farmer@gmail.com>
async function createAndAuthenticate() {
// Connect to the API with hub keys.
// Use withUserAuth for production.
const client = await Client.withKeyInfo({ key: 'HUB API KEY HERE' });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we encourage this pattern in a webpage?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly... no. But I'm not sure what the simple alternative is?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we could do an example on glitch or elsewhere. someplace where we can demo the use of the secret + simple token flow on npm.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeh good idea, even observablehq would work if we wanted to make others use their own secrets.

Signed-off-by: Carson Farmer <carson.farmer@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants