alexa / alexa-skills-kit-sdk-for-nodejs

The Alexa Skills Kit SDK for Node.js helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.
Apache License 2.0
3.12k stars 736 forks source link

Simplify SMAPI client instantiation. #679

Open sam-goodwin opened 3 years ago

sam-goodwin commented 3 years ago

Using the SMAPI SDKs has high friction. There are three manual steps:

  1. Create a Client ID (store somewhere safe)
  2. ask util generate-lwa-tokens
  3. Manually load ~/.ask/cli_config and include when instantiating the client.

Every developers has to do this if they want to use the SMAPI SDK.

Can we make it as simple as the AWS CLI?

# writes ~/.aws/config
aws configure
const credentials = new AWS.SharedIniFileCredentials({profile: 'work-account'});
new S3.Bucket({ credentials });

Desired Experience

# writes ~/.ask/cli_config
ask configure
import * as ASK from 'ask-smapi-sdk';

const credentials = new ASK.CliConfigCredentials({profile: 'work-account'});
new ASK.SMAPI({ credentials });
RonWang commented 3 years ago

+1 There is no doubt that a shared file for credential management would greatly simplify the authorization management.

In the meantime, ASK doesn't have the IAM part as AWS has. We need to investigate how much value the ClientID has for skill developers. Because the credential file defined by CLI is using its own ClientID. smapi-sdk has clientId as the input though.

rahulawl commented 1 year ago

Is this issue/feature-request still relevant? We are working on prioritization of relevant issues and cleanup of rest. If we don’t hear back in 2 weeks, we will assume that the issue is not relevant and we will close it.