Sorry, this is not going to work. Bootstrap and jquery were written for a pre-web components world and will need to evolve to work with web components.
One of the fundamental features web components introduces is scoping, via Custom Elements and ShadowDOM. When a custom element includes elements inside its shadowRoot, these elements are intended to be scoped to it, safe from the outside world. This means css is scoped to the element's shadowRoot and the elements in the shadowRoot are not directly accessible from the document (e.g. via document.querySelector). This has massive benefits for authors of custom elements. Consider one obvious, simple example: since shadowRoots are scoped you can safely use a simple id attribute to both find and style an element. There's no worry that this id might be used elsewhere on the page or that these styles might leak in or out of the element.
There is a cost for progress: existing tools will need to evolve to work within this new world. Before web components, tools like jquery could include code like $('[data-spy]') and be relatively sure that this would find the element to be affixed, where ever it exists on the page. Now they cannot. What this means is that, when using existing tools like bootstrap and jquery, ymmv! Sometimes things will work and sometimes they will not.
Specifically, in this case:
* The affix plugin looks like it's specifically looking for the window to scroll. This is almost certainly not what you want if it's used inside a custom element. If the custom element should affix something, then it is probably scrolling some content inside itself.
* The data-spy attribute won't work because jquery can't find it via $ (which uses document.querySelector) . You could get around that by using affix's javascript api, since it supports passing in a node reference (e.g. $(element_reference).affix(...); ).
* Next, the bootstrap css would need to be included in the custom element's shadowRoot.
* Finally, the position of the affix'd element is determined via jquery's offset() method. This doesn't appear to be compatible with ShadowDOM.