# apiSubscription | @coopenomics/sdk
Documentation for @coopenomics/sdk

# Function apiSubscription

- apiSubscription(options): ((query) => {
  ws: WebSocket;
  error(listener): void;
  off(listener): void;
  on(listener): void;
  open(listener): void;
  })

- #### Parameters

  - options: chainOptions

  #### Returns ((query) => {
  ws: WebSocket;
  error(listener): void;
  off(listener): void;
  on(listener): void;
  open(listener): void;
  })

  - - (query): {
      ws: WebSocket;
      error(listener): void;
      off(listener): void;
      on(listener): void;
      open(listener): void;
      }

    - #### Parameters

      - query: string

      #### Returns {
      ws: WebSocket;
      error(listener): void;
      off(listener): void;
      on(listener): void;
      open(listener): void;
      }

      - ##### ws: WebSocket

      - ##### error:function

        - error(listener): void

        - #### Parameters

          - listener: undefined | ((error) => void)

          #### Returns void

          - Defined in components/sdk/src/zeus/index.ts:55

      - ##### off:function

        - off(listener): void

        - #### Parameters

          - listener: undefined | (() => void)

          #### Returns void

          - Defined in components/sdk/src/zeus/index.ts:61

      - ##### on:function

        - on(listener): void

        - #### Parameters

          - listener: undefined | ((event) => void)

          #### Returns void

          - Defined in components/sdk/src/zeus/index.ts:52

      - ##### open:function

        - open(listener): void

        - #### Parameters

          - listener: ((socket) => void)
            - - (socket): void

              - #### Parameters

                - socket: unknown

                #### Returns void

          - Defined in components/sdk/src/zeus/index.ts:58
  - Defined in components/sdk/src/zeus/index.ts:12