As an ISV or Salesforce partner, you can distribute Apex code to customer
organizations using packages. Here we'll describe packages and package
versioning.
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. See Packaging ConnectApi Classes.