I want sample code for streaming api which should not used any package. the code should not have js package or any. i want to understand how streaming api is working. could anyone help on that please

1 Answer 1


The Streaming API is always based on a package, because it is a complicated subject. Bayeux Protocol, CometD, and Long Polling and the related parts else where assume you already know CometD, the underlying protocol mechanism. You would need to read an extensive amount of code and documentation to fully understand what's going on. However, I'm not dissuading you from doing so; I believe knowledge is useful, and you should seek it out. Just know that it's fairly impractical to know the details unless you plan on writing your own from scratch, and there's no reason to do so.

  • so if i want to build streaming api with new app i should use the package isn't it?
    – Eswari
    Commented Feb 11, 2019 at 7:18
  • 1
    @Eswari If using Visualforce, you would use a package, Lightning has a component built-in for this: lightning:empApi that you can leverage instead of writing code/importing third-party package.
    – sfdcfox
    Commented Feb 11, 2019 at 7:20
  • should we use streaming api to get notification in another app. My requirement is to get notification in another application whenever the field gets change in salesforce.
    – Eswari
    Commented Feb 11, 2019 at 9:52
  • @Eswari Yes, that's one practical use of the API.
    – sfdcfox
    Commented Feb 11, 2019 at 10:03
  • this is my another question, please don't mind. I want the notifications in another platform. example: java. For connected app i have tested in postman application. For streaming API is there any application like postman is available to test.
    – Eswari
    Commented Feb 12, 2019 at 4:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .