
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.
charisma-sdk-js
Advanced tools
yarn add charisma-sdk-js
The script can be pulled straight into the browser.
<script src="./charisma-sdk.js"></script>
<script>
(async function () {
const charisma = await Charisma.connect({ storyId: 13 });
charisma.on('start-typing', () => { ... });
charisma.on('stop-typing', () => { ... });
charisma.on('reply', (data) => {
if (data.reply.speech) {
charisma.speak(data.reply.speech.data);
}
});
charisma.start({ ... });
charisma.reply({ ... });
}){}
</script>
Use this to connect to Charisma and set up a new playthrough.
storyId
(number
): The id
of the story that you want to create a new playthrough for. The story must be published, unless a Charisma.ai user token has been passed and the user matches the owner of the story.version
(number
, optional): The version
of the story that you want to create a new playthrough for. If omitted, it will default to the most recent version. To get the debug story, pass -1
.userToken
(string
, optional): If the story is unpublished, pass a userToken
to be able to access your story.Returns a promise that resolves once the socket has connected.
const charisma = await Charisma.connect({
"storyId": 12,
"version": 4,
"userToken": "..."
})
To interact with the story, events are sent backwards and forwards along the websocket.
{
"startNodeId": 12, // Optional, default undefined
"speech": true // Optional, default false
}
{
"message": "Please reply to this!",
"speech": true // Optional, default false
}
{
"reply": {
"message": "Greetings and good day.",
"character": "Ted Baker",
"avatar": "https://s3.charisma.ai/...",
"speech": "...", // Stringified buffer
"metadata": {
"myMetadata": "someValue"
}
},
"endStory": false,
"path": [{ "id": 1, "type": "edge" }, { "id": 2, "type": "node" }]
}
This event has no additional data.
This event has no additional data.
To be used in conjunction with speech recognition (see below).
To be used in conjunction with speech recognition (see below).
To help you with speech-to-text and text-to-speech:
e.g.
charisma.on("reply", data => {
if (data.reply.speech) {
charisma.speak(data.reply.speech.data);
}
});
Starts browser speech recognition (Google Chrome only). charisma
will then emit recognise-interim
(player hasn't finished speaking, this is the current best guess) and recognise
(player has finished speaking and we're confident about the result) events.
The speech recognition will automatically pause when a character is speaking via charisma.speak
.
Stops browser speech recognition (Google Chrome only).
For further details or any questions, feel free to get in touch with ben@charisma.ai
v0.2.0
debug
option has been replaced with the version
option, which defaults to undefined
(the latest published story version).FAQs
Charisma.ai SDK for Javascript (browser)
We found that charisma-sdk-js 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.