Docs
API
Health
Ping

Ping

Ping API ping() returns if the API is online.

API operation

Lens.ping()
  .then((res) => {
    console.log(res);
  })
  .catch((err) => {
    console.log(err);
  });

API response

{
  "ping": "pong"
}

Full Code Example

import { Lens } from 'lens-protocol';
import { useEffect } from 'react';

export default function Example() {
  useEffect(() => {
    Lens.ping()
      .then((res) => {
        console.log(res);
      })
      .catch((err) => {
        console.log(err);
      });
  }, []);
}
Last updated on July 28, 2022