Skip to main content

Create a client

The client reads SPHYNX_API_KEY and throws if it is missing. Pass apiKey or baseUrl to override:
To see which organization a key acts for:
credential is { kind: "apiKey", name, start } for a key, where start is its first characters, never the secret.

Evals

Validators, preparation, profiles and mocks are written in an eval file. Import the suite and pass it in:
evals/smoke.eval.ts
suite records the file it was defined in, so start and startAndWait can compile it and ship its validators and mock servers, with everything they close over, to the sandbox. The client can’t start a batch on the local sandbox. Use sphynx eval --local for that.

Errors and cleanup

Invalid request fields fail before any network call. API failures carry an HTTP status when one is available. When Sphynx cannot be reached, the error says so and names the address it tried. The first request checks that the server answers and gives up within 5 seconds if it does not. After that, a read that gets no answer in 30 seconds gives up with an error that says the server was slow, not unreachable. A change is never cut off once the server has it, so it cannot be applied twice. Date fields are Effect DateTime.Utc values. Read epochMillis for a number.