I do not think you need to do any different for your UFM elements. You can use the UmbElementMixin on elements that goes into UFM, and then go about it the usual way, with .consumeConext(...)
But, if you like to know, then here is a example of using the ContextConsumer without any Umb Element or controller host implemented. This can be used on any web component:
So here is a little example of the simplest implemenation you can get.
// Write this in your constructor, or another early phase part of your code: (assuming
this
is the web component)
const localConsumer = new UmbContextConsumer(this, 'contenxt-token-alias', (context) => {
console.log('i got context', context)
});
When your element is connected, call:
localConsumer.hostConnected();
When you element gets disconnected, call:
localConsumer.hostDisconnected();