Preheat oven 350 F
In a bowl, add cream cheese, black pepper, carmelized onion, salt, spinach and parmesan and mix everything well. You should have about 1 cup of cheese filling.
You can use puff pastry or phyllo pastry to make this. If you’re using puff pastry, you won’t need to butter the sheets. If you’re using phyllo pastry, begin my taking 4-5 phyllo sheets, brushing each one lightly them with some melted unsalted butter. Cut the pastry in half lengthwise.
Place one tablespoon of filling at the end of the pastry and then fold it onto itself until you reach the end, making a triangle shape. Brush each borek with the egg wash and some sesame seeds or black seeds. Repeat this step until you have no more cheese filing left. Line a baking sheet with partchment paper and place each borek about one inch apart.
Place baking sheet on the middle rack and bake until golden and crispy about 15 -17 minutes. Make sure to keep any eye on them you do not want to burn them.