@dev-crew-berlin/enter-js-utils
v0.81.0
Published
utils such as vaildation and other helpers to work with data from the enter app
Downloads
356
Readme
js utils
install
npm install @dev-crew-berlin/enter-js-utils
packages
lib
Some common helper functions and types.
This also contains the dcb colors.
ui
react ui components for enter and dcb apps.
see: https://js-utils-main.dcb-utils.vercel.app
api-client
typed js client for the enter api.
import EnterAPIClient from '@dev-crew-berlin/enter-js-utils/api-client'
async function apiExample() {
// fetch access Token
const accessTokenResult = await EnterAPIClient.fetchAccessToken({
oidc: {
url: 'https://auth.enter.events',
projectId: '246359835166114187'
}
user: {
userId: '',
keyId: '',
key: ''
}
})
if (!accessTokenResult.success) {
throw new Error(accessTokenResult.error)
}
const accessToken = accessTokenResult.data.accessToken
// create api instance
const api = new EnterAPIClient({
credentials: { accessToken, url: 'https://api.enter.events' },
onLogout: (reason?: string) => {
deleteCredetials()
},
})
const instances = await api.getInstanceList()
const attendees = await api.getAttendeeList({ instanceId: instances[0].id })
}
models
The models retured from the api-client.
publish
This package is automatically published to npm for each new tag starting with v*
.
So you can run:
npm version patch # one of major | minor | patch or just write the version like v1.0.0
git push --follow-tags
You could also create the tag manually.
If the version in the git tag and package.json
differ the git tag is used.