You can follow this PR, and next revisions of it: [draft] lib: example usage and "lib" runmode - v4 by jasonish · Pull Request #11711 · OISF/suricata · GitHub
You’ll want to look at the example program: [draft] lib: example usage and "lib" runmode - v4 by jasonish · Pull Request #11711 · OISF/suricata · GitHub
It is still work in progress though.