activitypub isn’t something you can abstract into a library in a clean way in my experience. the best attempt here seems to be go-fed. most projects i know of implement it in their own way, specialized to the kind of platform they’re planning to build.