1.0.3 • Published 6 years ago

auth0-in-action v1.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

Build Status Coverage Status npm version

auth0-in-action

build authenticated google actions faster with auth0

Why did I build this?

There are a lot of great social integrations to be created on actions on google, but working with authentication is a friction point in building out these ideas. I want to help developers focus on building their awesome idea and avoid the potential case of someone getting frustrated with the process and give up.

How to use it!

import Authy from 'auth0-in-action'

// your actions on google code
app.intent('actions.intent.SIGN_IN', async (conv, params, signin) => {
    if (signin.status !== 'OK') {
        return conv.close('You need to sign in before using the app.');
    }
    
    const authy = new Authy("yourAuth0TenantDomainName", 
                            "auth0clientId", 
                            "auth0clientSecret");
                            
    const {access_token, username} = await authy.getSocialIdentity(conv.user.access.token);
    
    // do whatever you want with the access token -- like getting a users github repos
    conv.ask(`Thanks ${username} for signing for. What can I help you with today?`);
});
1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago