Skip to content

Library Usage

You can use lychee as a library for your own projects! Here is a “hello world” example:
use lychee_lib::Result;
async fn main() -> Result<()> {
let response = lychee_lib::check("").await?;

This is equivalent to the following snippet, in which we build our own client:
use lychee_lib::{ClientBuilder, Result, Status};
async fn main() -> Result<()> {
let client = ClientBuilder::default().client()?;
let response = client.check("").await?;

The client builder is very customizable:
let client = lychee_lib::ClientBuilder::builder()

All options that you set will be used for all link checks. See the builder documentation for all options. For more information, check out the examples folder.