Preheat the oven to 350°F (175°C). Line a 9×13-inch baking pan with parchment paper, leaving some paper over the sides for easy removal.
Prepare the crust by combining the flour, brown sugar, cinnamon, and salt in a large bowl.
Add the softened butter and mix until the ingredients form a crumbly dough.
Press the crust mixture firmly and evenly into the bottom of the prepared pan.
Bake the crust for 12–15 minutes, or until the edges are lightly golden. Remove it from the oven and let it cool slightly.
Prepare the cheesecake filling by beating the softened cream cheese and granulated sugar until smooth and creamy.
Add the eggs one at a time, mixing gently after each addition. Stir in the vanilla extract and sour cream, if using. Avoid overmixing.
Pour the cheesecake filling over the warm crust and spread it evenly.
Peel, core, and dice the apples into small pieces. Place them in a bowl and toss with the sugar, cinnamon, nutmeg, and lemon juice.
Spread the seasoned apples evenly over the cheesecake layer.
Make the streusel topping by combining the flour, brown sugar, oats, and cinnamon in a bowl.
Add the softened butter and mix with a fork or your fingers until coarse crumbs form. Stir in the chopped pecans, if using.
Sprinkle the streusel evenly over the apples.
Bake for 35–45 minutes, or until the edges are set and the center has only a slight jiggle.
Remove the pan from the oven and allow the cheesecake bars to cool completely at room temperature.
Cover the pan and refrigerate the bars for at least 2–4 hours, or overnight, before slicing.
Cut the chilled cheesecake into 24 squares using a sharp knife.
Drizzle the caramel sauce over the bars just before serving. Add a small sprinkle of flaky sea salt, if desired.