# Js contract

Canonical page: https://docs.ovok.com/flutter-sdk/reference/ovok_sdk/js-contract

{/* Generated by scripts/generate_reference.dart; do not edit. */}

## JsContract [#jscontract]

```dart
abstract interface class JsContract
```

Runs a call of the `@ovok/native/next` contract, such as `fhir.read`, in an embedded JavaScript engine.

### Methods [#methods]

#### JsContract.call [#jscontractcall]

```dart
Future<Object?> call(String name, List<Object?> args)
```

Calls `name`, written `namespace.method`, with JSON-encodable `args`.

Completes with the decoded JSON result and throws when the call fails.

| Parameter | Type | Kind | Default |
| ------ | ------ | ------ | ------ |
| `name` | `String` | positional |  |
| `args` | `List<Object?>` | positional |  |

Returns `Future<Object?>`.
