@quantum-hub/qhub-service
v1.1.1
Published
SDK to interact with managed services on the Kipu Quantum Hub.
Readme
Kipu Quantum Hub Service SDK
Installation
The package can be installed using npm:
npm install @quantum-hub/qhub-serviceUsage
const serviceEndpoint = "..."
const accessKeyId = "..."
const secretAccessKey = "..."
// Create a new client instance
const client = new HubServiceClient(serviceEndpoint, accessKeyId, secretAccessKey)
// List all service executions
const serviceExecutions = await client.api().getServiceExecutions()
// Start a new service execution
let serviceExecution = await client.api().startExecution({n_coin_tosses: 2, shots: 100}, {timeoutInSeconds: 60})
// Check the status of the service execution
serviceExecution = await client.api().getStatus({id: serviceExecution.id!})
// Wait for the service execution to finish
const finalStates = ["SUCCEEDED", "CANCELLED", "FAILED"]
while (!finalStates.includes(serviceExecution.status!)) {
serviceExecution = await client.api().getStatus({id: serviceExecution.id!})
}
// Get the result of the service execution
const result = await client.api().getResult({id: serviceExecution.id!})
// Get the logs of the service execution
const logs = await client.api().getLogs({id: serviceExecution.id!})
// Cancel the service execution if it is still pending or running
await client.api().cancelExecution({id: serviceExecution.id!})License
Apache-2.0 | Copyright 2026-now Kipu Quantum GmbH
