generalize filter-stream function, export credentials