Packaging ConnectApi Classes
If you include ConnectApi classes in a package, be aware of Chatter dependencies.
If a ConnectApi class has a dependency on Chatter, the code can be compiled and installed in orgs that don’t have Chatter enabled. However, if Chatter isn’t enabled, the code throws an error at run time.
In its reference documentation, every ConnectApi method indicates whether or not it supports Chatter.
See Also