![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@retter/sdk
Advanced tools
Readme
Using npm:
npm install @retter/sdk
Using yarn:
yarn add @retter/sdk
Using unkpg:
<script src="https://unpkg.com/@retter/sdk/bundle/index.js"></script>
Clients should initialize with project id. Instances with same project id always be cached.
const rio = Retter.getInstance({
projectId: '{PROJECT_ID}',
})
PROJECT_ID: Unique id of a project created in retter.io Console
Retter uses custom token to authenticate. This custom tokens can be given by an action or a cloud object.
await rio.authenticateWithCustomToken('{CUSTOM_TOKEN}')
Authentication statuses can be listened. SDK will fire an event that clients can be subscribe on status change.
rio.authStatus.subscribe((event: RetterAuthChangedEvent) => {
//
})
Event gives information about current auth status. Clients can check the authStatus
to determine if they need to show login/register pages or not.
interface RetterAuthChangedEvent {
authStatus: RetterAuthStatus
identity?: string
uid?: string
message?: string
}
enum RetterAuthStatus {
SIGNED_IN = 'SIGNED_IN',
SIGNED_IN_ANONYM = 'SIGNED_IN_ANONYM',
SIGNED_OUT = 'SIGNED_OUT',
AUTH_FAILED = 'AUTH_FAILED',
}
SDK will allow to use Retter Cloud Objects. Clients can subscribe realtime state changes, trigger cloud methods, ...
Firstly, a cloud object must be initilize with classId
. Additional config options can be seen in interface below.
const cloudObject = await rio.getCloudObject(config: RetterCloudObjectConfig)
interface RetterCloudObjectConfig {
classId: string
key?: {
name: string
value: string
}
instanceId?: string
method?: string
headers?: {
[key: string]: string
}
queryStringParams?: {
[key: string]: string
}
body?: {
[key: string]: any
}
httpMethod?: 'get' | 'delete' | 'post' | 'put'
}
Clients can be subscribe to realtime state (public, user and role states) changes. On first subscription, it gives current state.
cloudObject.state.public.subscribe((state: { [key: string]: any }) => {
//
})
cloudObject.state.user.subscribe((state: { [key: string]: any }) => {
//
})
cloudObject.state.role.subscribe((state: { [key: string]: any }) => {
//
})
Any cloud method can be called via sdk. method
parameter must be specified. Other parameters can be seen in interface below.
const response = await cloudObject.call(params: RetterCloudObjectCall)
interface RetterCloudObjectCall {
method: string
headers?: {
[key: string]: string
}
queryStringParams?: {
[key: string]: string
}
body?: {
[key: string]: any
}
httpMethod?: 'get' | 'delete' | 'post' | 'put'
}
Call method will return a response with RetterCallResponse
type includes data
, status
and headers
.
Clients also access state via method call.
const response = await cloudObject.getState(params: RetterCloudObjectRequest)
interface RetterCloudObjectRequest {
headers?: {
[key: string]: string
}
queryStringParams?: {
[key: string]: string
}
body?: {
[key: string]: any
}
httpMethod?: 'get' | 'delete' | 'post' | 'put'
}
Get stae method will return a response with RetterCallResponse
type includes data<RetterCloudObjectState>
, status
and headers
.
Cloud objects available methods can be accessed on methods
array/
const methods = cloudObject.methods: RetterCloudObjectMethod[]
interface RetterCloudObjectMethod {
tag?: string
name: string
sync?: boolean
readonly?: boolean
inputModel?: string
outputModel?: string
}
FAQs
Client sdk for retter.io
The npm package @retter/sdk receives a total of 231 weekly downloads. As such, @retter/sdk popularity was classified as not popular.
We found that @retter/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.