---
name: "fido_init"
section: "3"
platform: "linux"
package: "libfido2"
version: "1.17.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/fido_init"
---

# fido\_init(3)

initialise the FIDO2 library

## NAME

**fido\_init**, **fido\_set\_log\_handler** – initialise the FIDO2 library

## SYNOPSIS

**#include \<fido.h\>**

```
typedef void fido_log_handler_t(const char *);
```

*void*\

**fido\_init**(*int flags*);

*void*\

**fido\_set\_log\_handler**(*fido\_log\_handler\_t \*handler*);

## DESCRIPTION

The **fido\_init**() function initialises the *libfido2* library. Its invocation must precede that of any other *libfido2* function in the context of the executing thread.

If FIDO\_DEBUG is set in *flags*, then debug output will be emitted by *libfido2* on *stderr*. Alternatively, the FIDO\_DEBUG environment variable may be set.

If FIDO\_DISABLE\_U2F\_FALLBACK is set in *flags*, then *libfido2* will not fallback to U2F in [fido\_dev\_open(3)](/fido_dev_open/3.md) if a device claims to support FIDO2 but fails to respond to a CTAP 2.0 greeting.

The **fido\_set\_log\_handler**() function causes *handler* to be called for each log line generated in the context of the executing thread. Lines passed to *handler* include a trailing newline character and are not printed by *libfido2* on *stderr*.

## SEE ALSO

[fido\_assert\_new(3)](/fido_assert_new/3.md), [fido\_cred\_new(3)](/fido_cred_new/3.md), [fido\_dev\_info\_manifest(3)](/fido_dev_info_manifest/3.md), [fido\_dev\_open(3)](/fido_dev_open/3.md)
