
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
kirgawa-react-sdk
Advanced tools
Official SDK for the Kirgawa APP
A simple JavaScript SDK for interacting with the Kirgawa API. The kirgawa-react-sdk package provides a hook useStageTimer that allows you to track the duration of a stage event in a React application.
To install the package, you can use npm or yarn:
npm install kirgawa-react-sdk
yarn add kirgawa-react-sdk
First, import the SDK and initialize it with your API key and context.
The init function must be called with an API key and a context before using the hook. The apiKey parameter is a string representing the API key for the Kirgawa SDK, and the context parameter can be set to either "prod"
or "local"
depending on the environment.
import kirgawa from 'kirgawa-sdk'
kirgawa.init({
apiKey: 'YOUR_API_KEY',
context: 'prod' // 'local', or 'prod'
})
You can generate an API key in the Kirgawa dashboard.
Then, import the hook and use it in your component:
getStageTimers()
This method gets a list of all the stage timers available.
kirgawa.getStageTimers().then(response => {
console.log(response.data)
}).catch(error => {
console.log(error)
})
getStageTime(id: string)
This method gets a single stage timer by its id.
kirgawa.getStageTime('STAGE_TIMER_ID').then(response => {
console.log(response.data)
}).catch(error => {
console.log(error)
})
createStageTimer(data: CreateStageTimer)
This method creates a new stage timer with the provided data.
const data = {
title: 'Event Title',
startAt: '2022-01-01T00:00:00.000Z',
endAt: '2022-01-01T01:00:00.000Z', // pass any date value if you don't want to set an end date
meta: '{"description": "Event Description"}' // optional
}
kirgawa.createStageTimer(data).then(response => {
console.log(response.data)
}).catch(error => {
console.log(error)
})
useStageTimer(options: StageTimerOptions)
Then, you can use the useStageTimer
hook in your component:
import { useStageTimer } from 'kirgawa-react-sdk';
const data = useStageTimer({ continuous: true, eventId: '7dfbeeec-ce2e-47ef-adca-e3dc758a4a07' }) as any;
The useStageTimer hook takes an options object with the properties continuous and eventId. The continuous property is a boolean that indicates if the timer should continue counting even when the end event has been triggered (defaults to false). The eventId property is a string that represents the event id. The hook returns an object with the following properties:
hour
: the number of hours that have passed since the start eventminute
: the number of minutes that have passed since the start eventsecond
: the number of seconds that have passed since the start eventtimestamp
: the timestamp of the start eventtimeSpent
: the number of seconds that have passed since the start eventerror
: an error object if there was an error during the start or end eventsonEnd()
: a function that can be called to trigger the end eventonStart()
: a function that can be called to trigger the start eventIt's important to note that the eventId property is required for the hook to work. If the eventId is not provided, the hook will return an object with the error property set to an error object.
Sure, here's an example of how you can destructure the data object to access the properties directly:
import { init, useStageTimer } from 'kirgawa-react-sdk';
init({
apiKey: "Y2xjeHlzZWx3MDAwNDFqMXI2cHB3YzdqYw.xzHc7_K3OkzZkIkJdPdLX7ufFYnAHncsIcFa1VQqbi5A_KmGSgmBy_Unw_mZ",
context: 'local'
})
const ExampleApp = () => {
const { hour, minute, second, timestamp, onEnd, onStart, timeSpent, error } = useStageTimer({ continuous: true, eventId: '7dfbeeec-ce2e-47ef-adca-e3dc758a4a07' });
return <div>
<button onClick={onEnd}>End</button>
<button onClick={onStart}>Start</button>
<div>Hour: {hour}</div>
<div>Minute: {minute}</div>
<div>Second: {second}</div>
<div>Time spent: {timeSpent}</div>
</div>;
};
CreateStageTimer
export type CreateStageTimer = {
title: string
startAt: string
endAt?: string
meta?: string
}
StageTimerOptions
export type StageTimerOptions = {
continuous?: boolean
eventId: string
}
KirgawaSDKInit
export type KirgawaSDKInit = {
apiKey: string
context: 'local' | 'prod'
}
FAQs
Official SDK for the Kirgawa AP
The npm package kirgawa-react-sdk receives a total of 1 weekly downloads. As such, kirgawa-react-sdk popularity was classified as not popular.
We found that kirgawa-react-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.