serverless / platform-sdk

Serverless Platform SDK
Apache License 2.0
17 stars 7 forks source link

Onboarding sdk funcs #64

Closed dschep closed 5 years ago

dschep commented 5 years ago

There already was a createApp function. Added:

how to use:

import { createApp, getApps, createTenant, registerUser, getLoggedInuser } from '@serverless/platform-sdk'

const registerResp = await registerUser('email@example.com', 'password')
// response contents of that are still TBD

const { idToken, username } = getLoggedInUser()
await createTenant({
  title: 'newww',
  ownerUserName: user.username,
  token: user.idToken,
  tenant: 'newww'
}
const apps = await getApps({ token: user.idToken, tenant: 'newww' })
await createApp({
  tenant: 'newww',
  token: user.idToken,
  app: 'appname'
}